Pakistan fought back after a first innings collapse on the first day of the series-deciding third and final Test against South Africa at Newlands on Friday.
South Africa were 131 for five at the close of play in reply to Pakistan's 157 all out.
Mohammad Yousuf saved Pakistan from total embarrassment, hitting more than half his team's runs before being last man out for a sparkling 83, made off 90 balls.
Makhaya Ntini and Jacques Kallis took four wickets each as Pakistan's batting folded after they were sent in to bat.
South Africa lost two early wickets to opening bowler Mohammad Asif before South African captain Graeme Smith (64) and senior batsman Jacques Kallis (28) put on 80 for the third wicket to put the home team in charge.
But Kallis and Smith were out before the close, and were joined by AB de Villiers, who missed a googly from leg-spinner Danish Kaneria, as Pakistan bowled themselves back into contention on a pitch which helped both seam and spin bowlers.
It could have been better for the tourists if wicketkeeper Kamran Akmal had not added to a list of lapses in the series when he missed a straightforward stumping chance when Ashwell Prince, on nine, went down the wicket to Kaneria and the ball went for four byes.
Prince was unbeaten on 18 at the close.
South African coach Mickey Arthur was confident that his team could win if they could gain a reasonable first innings lead.
"If we get 100 ahead we can control the Test," he said before adding that he thought the pitch was unlikely to last five days. "You look down the wicket and it looks as though there are two different playing surfaces."
Yousuf agreed the pitch was also a testing strip.
"It's not an easy wicket but if you can get in you can make runs," said Yousuf who added that he had prepared for the tour by batting on a concrete slab against a bowling machine, practising to leave the ball and to hook and cut.
With the teams locked at 1-1, South African captain Graeme Smith gambled successfully that his fast bowlers would be able to make early inroads on a pitch which he believed had some moisture.
Eight of the batsmen dismissed fell to catches behind the wicket or in the slips.
A strange-looking pitch was bare at the southern Wynberg end, with bowlers' footmarks already prominent on the first day, while the Kelvin end was well-grassed.
Pakistan made a bright start when nine runs were scored off Dale Steyn's first over, including two fours by Mohammad Hafeez, but the rest of the morning was an uphill struggle for the batsmen.
Hafeez was caught by De Villiers at third slip for 10 when he got a thick edge to a lifting delivery from Ntini, who struck again when he had Yasir Hameed caught by Kallis at second slip for seven.
Kallis replaced Steyn and took a wicket in his second over when left-handed opener Imran Farhat (20) was squared up and edged a catch to Smith at first slip.
Younis Khan, one of the heroes of Pakistan's five-wicket win in the second Test in Port Elizabeth, fell for eight when he chased a wide ball from Kallis.
Captain Inzamam-ul-Haq was caught behind off Andrew Hall soon after lunch and was quickly followed by Kamran Akmal.
Yousuf and Mohammad Sami shared the only worthwhile partnership of the Pakistan innings, putting on 60 for the seventh wicket off only 58 balls, of which Sami made four.