South African spinner Paul Harris took a career-best five for 73 against Pakistan as the visitors extended their lead on the third day of the first Test on Wednesday.
The 28-year-old left-armer took full advantage of a spin-friendly pitch to dismiss the home team for 291 after Pakistan fought hard to avoid the follow-on at the National Stadium.
South Africa reached 76-3 at close of play to give them an overall lead of 235 with seven wickets intact, having scored 450 in the first innings. Jacques Kallis was unbeaten on 18 and Ashwell Prince on 11 not out.
Proteas' wicket-keeper Mark Boucher meanwhile set a new world record in Tests for victims behind the stumps, surpassing former Australian player Ian Healy's tally of 395.
Boucher -- with 378 catches and 18 stumpings -- beat the record in his 103rd Test, compared with 119 Tests for Healy.
The tourists will now rely mainly on Kallis, who hit 155 in the first innings, to take them to a winning total on the fourth day when the pitch is set to further deteriorate and aid the spinners.
South Africa were given an untroubled start of 41 in their second innings before Abdul Rehman struck twice in the space of two runs.
The left-armer had Smith caught behind for 25 and in his next over got Hashim Amla stumped off a looping delivery. Amla failed to score.
Leg-spinner Danish Kaneria then dismissed Herschelle Gibbs for 18 when Faisal Iqbal smartly caught an attempted sweep at silly mid-off.
Harris, whose previous best of 4-46 was also against Pakistan at Centurion earlier this year, ended a defiant 84-run seventh-wicket stand between captain Shoaib Malik (73) and his deputy Salman Butt (24).
At 238-8 Pakistan were all but condemned to follow on, with Harris extracting both spin and bounce.
But number ten Kaneria with an unbeaten 26 and Umar Gul (12) saved the home team from the humiliation of batting a second time.
Pakistan, resuming at a precarious 127-5, lost Rehman as early as the eighth over of the day when Andre Nel forced an edge off the bat which was caught by Boucher behind the stumps.
Butt, who was unable to open the innings on Tuesday after being hospitalised with stomach pains, defied doctors' advice for a two-day rest to help Malik take the home team to 219-6 at lunch.
Malik hit Harris for two boundaries and a six to reach his half-century and also complete 1,000 runs in his 19th Test.
It was Harris who provided the breakthrough when he trapped Butt in front of the wicket, before Malik rashly stepped out of his crease to a flighted Harris delivery and was stumped by Boucher.
Malik hit six boundaries and a six during his stubborn 227-minute stay.
Gul and Kaneria added 21 runs for the ninth wicket before Harris struck again, dismissing Gul, who was stumped by Boucher for 12 to give the keeper his new milestone.
Kaneria then added another 32 runs for the last wicket with Mohammad Asif (10), before Dale Steyn wrapped up the innings by bowling Asif to finish with 2-50. Nel took 2-59.
The second Test starts in Lahore on Monday.