South Africa lost three wickets in the afternoon session on day one of the third Test match with Pakistan, reaching tea on 201-5.
Resuming after lunch on 104-2, the home side were dealt a blow when Faf du Plessis was dismissed immediately for 29.
That brought AB de Villiers to the crease, and he and Hashim Amla put on a partnership of 79 before Pakistan picked up the wicket of Amla for 92.
Dean Elgar entered the action with the intention of supporting De Villiers until tea, but Rahat Ali struck 10 minutes before the end of the session, trapping Elgar in front of his stumps.
Pakistan were building momentum, but De Villiers and Robin Peterson ensured that South Africa reached the interval on 201-5.