Paceman Dale Steyn took five wickets to inspire South Africa to a hard-fought 160-run win over Pakistan in the first Test here on Friday, giving the tourists a 1-0 lead in the two-match series.
Steyn captured the prized wicket of Younis Khan, who made 126, before wrapping up the tail to dismiss the home team for 263 as they chased a mammoth 424 runs on the fifth and final day at the National Stadium.
Once Younis was dismissed before lunch the home team's chances of winning or saving the match were effectively over.
Steyn, who finished with 5-56, ended Younis's four hours of aggression with a sharp delivery that kept low and hit the off-stump.
While Younis was at the crease the home team had a chance of forcing an unlikely victory.
Shoaib Malik (30) and Misbah-ul Haq (23) tried to put up a fight but were undone by the second new ball after lunch.
Malik was the last man out, caught off Makhaya Ntini for his only wicket in the match as South Africa captured the last six wickets for just 66 runs to complete their first victory in Pakistan since they won at Faisalabad in 1997.
The defeat is only Pakistan's second at the National Stadium in 40 Tests. They lost to England here in 2000.
Resuming Friday at 146-3, still needing 278 for victory, Pakistan lost nightwatchman Mohammad Asif, caught by Hashim Amla off Andre Nel for six.
Younis was the key for Pakistan after counter-attacking against the South African bowlers on Thursday during an unbeaten innings of 93.
He flicked paceman Nel over mid-wicket for his 15th boundary to reach his 13th Test hundred off just 108 balls. It was his first hundred against the Proteas and his first in the second innings of a Test.
Younis hit 18 boundaries and a six during his 160-ball knock and caused jitters in the opposition's ranks.
South Africa could have removed Malik for one had AB de Villiers held on to a sharp chance off left-arm spinner Paul Harris, who did produce some sharp turn but failed to add to his one wicket taken on Thursday.
Pakistan were precariously placed on 230-5 at lunch, with Malik and Haq at the crease. They lost Haq in the first over after the break when Nel trapped him in front of the wicket.
Kamran Akmal, who had a poor match behind the stumps, was caught behind off Harris, who finished with 2-58 to follow up his five wickets in the first innings.
South Africa took the second new ball and were rewarded as Steyn trapped Abdul Rehman in front of the wicket to bring the tourists closer to victory.
In his next over, Steyn had Umar Gul (eight) caught at mid-off by Nel before Ntini wrapped up the match with Malik's wicket.
Jacques Kallis was declared man-of-the-match for his feat of scoring centuries in both innings.
The second Test starts in Lahore on Monday.