South Africa took command of the second Test against Pakistan, building on their lead on day three at the Gaddafi Stadium here.
The tourists were 66-2 in their second innings at tea -- for an overall lead of 217 -- after Makhaya Ntini took three wickets in one over to dismiss Pakistan for just 206.
South Africa made 357 in their first innings.
Pakistan, trailing 1-0 in the two-match series, took the second wicket in the last over before tea when left-arm spinner Abdul Rehman bowled Hashim Amla for 17. South African skipper Graeme Smith was unbeaten on 28.
Opener Herschelle Gibbs was the other batsman out, caught behind off a wild shot off paceman Umar Gul for 16 on a day when Ntini cleaned up Pakistan's tail to give the tourists an upper hand.
Ntini's burst, in his second over of the day, included the wickets of Misbah-ul Haq (41), Umar Gul and Danish Kaneria without scoring as Pakistan lost their last six wickets for just 66 runs after resuming at 140-4.
Pakistan had pinned their hopes on experienced batsman Inzamam-ul Haq who added just four to his overnight score before he edged Jacques Kallis to Mark Boucher. Inzamam hit one boundary in his unconvincing 14.
The 37-year-old batsman now needs just six runs in the next innings to erase the record of the most Test runs by a Pakistani batsman currently held by Javed Miandad with 8,832.
Captain Shoaib Malik did not last long as he failed to keep a sharp rising delivery from paceman Dale Steyn and was caught at short-leg by Hashim Amla for just one.
Misbah, who made a career-best 41, added 39 runs for the seventh wicket with Rehman (25 not out) before Ntini ended any hopes of a late-order charge.
Ntini, who took just one wicket in the first innings, almost took a hat-trick. He dismissed Haq, who improved on his best Test score of 23, caught behind off a rash drive outside the off-stump.
He then trapped Gul with his second delivery and then came agonisingly close when an edge off Kaneria fell short of the slips fielder. Off his sixth, Ntini had Kaneria caught by Mark Boucher for his 400th victim.
Boucher set a world record for the most dismissals behind the stumps in the first Test in Karachi, beating Australian Ian Healy's record of 395.