Lahore:South Africa spoiled Pakistan paceman Shoaib Akhtar's comeback match on Monday with a stunning 14-run victory in the fifth and final limited-overs game to clinch the series 3-2.
Pakistan was coasting along well at 199 for four in the 41st over before it lost the last six wickets for 20 runs to get dismissed for 219 in 46.3 overs.
Akhtar took four for 43 to restrict South Africa to 233-9 off 50 overs with Jacques Kallis scoring a fighting 86 and Herschelle Gibbs making a fine 54.
Younis Khan (58) and Mohammad Yousuf (53) shared a valuable 106-run partnership off 134 balls before Pakistan stuttered in its run chase with Albie Morkel grabbing four wickets for 44 and man of the match Makhaya Ntini taking 4-61.
Khan and Yousuf departed in space of 19 deliveries that opened Pakistan's suspected lower order in front of Morkel and Ntini.
Captain Shoaib Malik was clean bowled by Morkel for 23 in the 41st over and Misbah-ul-Haq was brilliantly caught by Jean-Paul Duminy off Ntini.
However, AB de Villiers took a brilliant running catch to dismiss dangerman Shahid Afridi and Pakistan lost its last two wickets at the very same total of 219 that left around 28,000 home team supporters stunned.
Earlier, Akhtar - playing his first game after serving a ban of 13 international matches - halted South Africa with three wickets in his last three overs that included the prized wicket of top-scorer Kallis.
Kallis should have been dismissed on two but wicketkeeper Akmal spilled a regulation catch in Akhtar's second over. Akhtar had to wait until the 49th over when Malik took a brilliant running catch in the fast bowler's return spell to end Kallis' 130-ball innings.
Kallis' fighting innings included four boundaries and a straight six, but none of the lower middle-order could accelerate in front of Pakistan's disciplined bowling.
South Africa had a bumpy start after it won the toss and elected to bat first. Akhtar clipped the off-stump of captain Graeme Smith off the first delivery the South African captain faced off the express bowler, and had Akmal not dropped the catch off Kallis it could have been 13-2.
Herschelle Gibbs (54) dominated the 80-run stand off 112 balls with Kallis and hit 10 boundaries in his half century before Pakistan struck through leading wicket-taker in the series, unheralded medium fast Rao Iftikhar (3-45).
Gibbs, who faced 61 balls, tried to play across the line and Iftikhar knocked back the middle stump before Duminy (44) and Kallis shared another 75-run partnership off 108 balls.
Iftikhar hit back hard in his return spell and added two more scalps to raise his tally of wickets to 12 in the five-match series.
Duminy skied a catch to Akmal and then Sohail Tanvir took a well judged catch to dismiss Shaun Pollock at the edge of the boundary.
Akhtar, who last played his limited-overs international against England in September 2006, returned for his three-over spell and got the wickets of Mark Boucher (5) Kallis and Morkel (5) as South Africa could add just 56 runs in the last 10 overs and lost six wickets.
The last game of the series was shifted to Lahore after this month's suicide bombing in Karachi that resulted in 145 deaths.