Karachi: South African left-arm spinner Paul Harris took a career best 5 for 73 as Pakistan narrowly avoided the follow-on in the first Test at the National Stadium here on Wednesday.
Harris ended defiant knocks by Pakistani captain Shoaib Malik (73) and his deputy vice-captain Salman Butt (24) to help the tourists dismiss Pakistan for 291 in their first innings on the third day.
South Africa, who scored 450 in their first innings, have a lead of 159 runs.
Tail-ender Danish Kaneria, who made 26 not out, hit fast bowler Andre Nel for two boundaries to avert the humiliation of the follow-on after Malik and Butt had fallen with the score on 238.
Kaneria and last man Mohammad Asif (10) added 32 runs before Dale Steyn bowled Asif to finish with 2-50.
The 28-year-old Harris trapped Butt in front of the wicket in the eighth over after lunch to end a badly-needed seventh wicket stand of 84 with Malik.
Malik's steady knock ended rashly when he stepped out of his crease to a flighted Harris delivery and was stumped by wicket-keeper Mark Boucher.
The home team skipper hit six boundaries and a six and also completed 1,000 runs in his 19th Test.
Umar Gul and Kaneria added 21 runs for the ninth wicket before Harris struck again, dismissing Gul, who was stumped by Boucher for 12.
The dismissal took Boucher to a new world record in Tests for victims behind the stumps, surpassing former Australian Ian Healy's tally of 395. Healy (366 catches and 29 stumpings) took 119 Tests to set the record.
Boucher (378 catches and 18 stumpings) is playing his 103rd Test.
Harris's previous best of 4-46 was also against Pakistan, recorded at Centurion earlier this year.
Earlier, Malik and Butt came together at 149-6 with Pakistan facing the follow-on. They defied South African attack for two-and-a-half hours before Harris dismissed both in the space of just five runs.
Butt, who was unable to open the innings on Tuesday after being hospitalised with stomach pains and defied doctor's advice to take two-days rest, helped Malik take the home team to 219-6 at lunch.
Resuming at 127-5, the home team lost Abdul Rehman when Nel had Rehman caught behind for nine.
Brief Scores (at tea, D-3):
South Africa Ist innings 450 all out Vs Pakistan Ist innings 291 all out (Malik 73, Akmal 42, Hafeez 34, Butt 24; Harris 5 for 73, Steyn 2 for 50, Nel 2 for 59).