Pacer Dale Steyn took five wickets to lead South Africa to a thumping 160-run victory over Pakistan just before tea on the final day of the first Test at the National stadium on Friday.
Pakistan were bowled out for 263, chasing an improbable victory target of 424 runs, with captain Shoaib Malik the last man out after an obdurate 30 runs from 99 balls.
"The boys have really worked hard for this one and it was a pretty emotional moment for us out there today," South African skipper Graeme Smith said.
Steyn, playing in his 12th Test, took his third five-wicket haul in a Test when he finished with 5 for 56 to give South Africa their eighth win in 15 matches against Pakistan and only their second in Pakistan.
They last won in Faisalabad in 1997. Pakistan suffered just their second defeat at the National stadium venue in 40 Tests.
The Pakistan innings was wrapped up just before tea despite a blazing hundred from Younis Khan who hit his 13th Test career hundred and his first against South Africa.
Pakistan lost their last five wickets in the second session for 33 runs after Andre Nel, who completed his 100 Test wickets, trapped Misbah-ul-Haq leg before for a patient 23 from 95 balls.
Misbah and Malik had put on 33 when their stand was broken after which wickets kept on falling regularly.
Umar Gul was caught by Nel off Steyn and Malik went trying to pull Makhaya Nitini to give him his only wicket of the match.
Jacques Kallis, who scored two hundreds in the match, bagged the man of the match award.
It was South Africa's first victory in the sub-continent, apart from their win in Bangladesh, since 2000 when they beat India and Sri Lanka on away tours.
"To win in the sub-continent in meaningful and this victory ranks up there for me as a Test captain," Smith said.
South Africa's big break came in the first session when they got rid of the dangerous Younis who had resumed on a swashbuckling 93 from 99 balls this morning.
He continued in the same vein going to his hundred in the third over of the morning by playing Nel towards square leg for another of his 15 fours in his century from 108 balls.
He was finally beaten by Steyn by one that kept low before lunch and that opened the gates for the visitors on a pitch that was slow but had turn and uneven bounce.
Nel got his 100th wicket when he had nightwatchman Mohammad Asif (6) caught by Hashim Amla off a flier for the first wicket of the day.
Nel became only the 11th South African to get 100 Test wickets.
South Africa (1st innings): 450
Pakistan (Ist innings): 291
South Africa (2nd innings): 264 for 7 dec
Pakistan (2nd innings):
Mohammad Hafeez b Steyn 1
Salman Butt c Amla b Steyn 3
Younis Khan b Steyn 126
Faisal Iqbal c Kallis b Harris 44
Mohammad Asif c Amla b Nel 6
Misbah-ul-Haq lbw Nel 23
Shoaib Malik c Nel b Ntini 30
Kamran Akmal b Boucher b Harris 9
Abdul Rehman lbw Steyn 0
Umar Gul c Nel b Steyn 8
Danish Kaneria not out 0
Extras: (b-8, lb-4, nb-1) 13
Total: (all out in 84.5 overs, batting time 374 mts) 263
Fall of wkts: 1-1, 2-20, 3-134, 4-161, 5-197, 6-230, 7-239, 8-249, 9-257
Bowling: Makhaya Ntini 12.5-4-34-1, Dale Steyn 15-3-56-5, Andre Nel 19-5-59-2 (nb-1), Paul Harris 30-8-58-2, Graeme Smith 3-0-33-0, Jacques Kallis 4-3-4-0, Hashim Amla 1-0-7-0.
Umpires: Mark Benson (ENG) and Simon Taufel (AUS)
TV umpire: Riazuddin
Match referee: Alan Hurst (AUS)
Result: South Africa won by 160 runs
Second Test in Lahore from October 8.