Jacques Kallis' 43rd half century helped South Africa reach 115 for three in its second innings -- still 26 runs in arrears of Pakistan on day two on Saturday of the second cricket Test.
Kallis was undefeated on 50 at stumps at St George's Park, sharing an unbroken 52-run partnership with Ashwell Prince, who had 21.
Pakistan captain Inzamam-ul-Haq was left stranded on 92 not out -- shy of his 26th Test century -- when his team was all out for 265 in its first innings in reply to South Africa's 124.
With Shoaib Akhtar out of the attack because he hurt a hamstring while batting, the Pakistan battery was carried by Mohammad Asif and Mohammad Sami, who accounted for all three South African wickets.
Asif struck first, removing the openers: Graeme Smith was well caught by opposite captain Inzamam low down to his left for 10, then A.B. de Villiers was bowled for 15 at 30-2 by a beauty that cut inside the line the batsman played.
Sami produced a fine delivery of his own, completely undoing Hashim Amla and uprooting his middle stump for 16 at 63-3.
Kallis and Prince dug in, with Kallis looking increasingly entrenched at the crease as his score grew.
Pakistan started the day at 135 for six and a first-innings lead of 11. A 74-run last-wicket partnership between Inzamam and Asif lifted the tourists to a lead of 142.
When South Africa pace bowler Makhaya Ntini dismissed nightwatchman Sami for 10, it was his 300th wicket in Tests.
"It's been a marvelous day," Ntini said. "To take 300 wickets at home is a wonderful thing."
Kallis got Shoaib to edge a catch to Mark Boucher for 4 at 184-8, and Shaun Pollock got a lifting delivery to track back at Danish Kaneria to have him caught by Herschelle Gibbs for 1.
With Pakistan on 191-9, and the lead just 57, the Proteas' cause for optimism was dulled by Inzamam's shepherding of Asif in the 10th-wicket partnership.
The partnership was broken by Ntini, who took his sixth wicket of the innings in bowling Asif for 7.