Pakistan survived a few anxious moments before forcing a draw in the second Test on Tuesday to seal their first Test series win over South Africa.
Pakistan ended on 242 for six, 60 runs short of their victory target.
Shoaib Malik (23) and Moin Khan (nine) played out 15.5 tense overs in a stand of 33, forcing the draw after Pakistan had lost three wickets in 22 balls to give South Africa a sniff of victory.
Pakistan took the series by virtue of their win in the first Test at Lahore, only their second in 10 matches against South Africa.
The touring side scored 278 and 371 for eight declared, with Pakistan making 348 and 242 for six.
Pakistan appeared to be close to an honourable draw on 187 for three after two sessions of tense cricket before running into trouble.
After spinner Paul Adams had Asim Kamal (38) caught by wicketkeeper Mark Boucher, fast bowler Makhaya Ntini trapped Inzamam-ul-Haq lbw for 60.
In the next over Shaun Pollock bowled Abdul Razzaq (10) with a ball that came back sharply to leave Pakistan facing possible defeat with 18 overs remaining.
Pakistan had an important let off when Gary Kirsten put down Shoaib Malik (8) with the total on 219 for six.
The ball ballooned off Malik's bat handle as he tried to avoid a short ball from Ntini but Kirsten failed to latch on to the chance.
The experienced Moin, who took 29 balls to get off the mark, and Malik than pulled down the shutters before the match was called off two overs early.
The South Africans had 94 overs to force a result but with the Pakistanis dropping anchor the bowlers struggled to get wickets on a pitch that held up well.
Jacques Kallis trapped Imran Farhat (eight) lbw and Ntini had Yasir Hameed (17) caught at deep square leg before lunch when only 55 runs were scored in 30 overs.
But Taufeeq Umar made 71, including 12 fours, Inzamam 60 and Kamal 38 to rescue their side.
Taufeeq played a careless shot to be caught by Graeme Smith at wide mid-on off Robin Peterson 25 minutes before tea.
Declared man of the series for his 313 runs and nine catches -- a record by a Pakistani fielder -- Taufeeq also become the leading Test run scorer for Pakistan against South Africa with a tally of 593 runs in eight innings.
Inzamam was the cornerstone of the batting, putting on 79 from 175 balls with Taufeeq and 62 with Kamal on the way to his 33rd Test half century.
The series win improved Pakistan's position from seventh to fifth place in the official Test rankings.
Scoreboard:
South Africa first innings: 278 (H.Gibbs 98, G.Kirsten 54; Shabbir Ahmed 4-74).
Pakistan first innings: 348 (Imran Farhat 128, Taufeeq Umar 68; S.Pollock 6-78)
South Africa second innings: 371-8 declared (G.Smith 65, G.Kirsten 118)
Pakistan second innings: (overnight 8-0)
Taufeeq Umar c Smith b Peterson 71
Imran Farhat lbw b Kallis 8
Yasir Hameed c Dippenaar b Ntini 17
Inzamam-ul-Haq lbw b Ntini 60
Asim Kamal c Boucher b Adams 38
Abdul Razzaq b Pollock 10
Shoaib Malik not out 23
Moin Khan not out 9
Extras: (b-1 lb-1 nb-4) 6
Total: (for six wickets, 98 overs) 242
Did not bat: Mushtaq Ahmed, Shabbir Ahmed, Danish Kaneria
Fall of wickets: 1-18 2-46 3-125 4-187 5-209 6-209
Bowling: Pollock 22-12-27-1 (nb-3), Ntini 20-7-45-2 (nb-1), Kallis 19-6-51-1, Adams 20-2-75-1, Peterson 15-6-21-1, Smith 2-0-21-0.
Result: Match drawn.
First Test: Pakistan won by 8 wickets.
Series result: Pakistan win 1-0.