He bowled South African captain Smith with the third legitimate delivery of the innings for nought and could have had Kallis for two had wicket-keeper Kamran Akmal not dropped a simple catch.

Kallis, who managed just 27 runs in the first four matches, made the home team pay for the lapse as he hit four boundaries and a six during his 130-ball knock.

Kallis and Gibbs repaired the innings through a second-wicket stand of 80. Gibbs hit 10 boundaries before he was bowled by Iftikhar.

Kallis added 32 with AB de Villiers (17) and another 75 for the fourth wicket with Duminy, who hit three boundaries and a six.

Iftikhar had Duminy caught to put the brakes on South African progress before Akhtar returned for his third spell to dismiss Mark Boucher (five), Albie Morkel (five) and Kallis in a fiery display of pace bowling.

Earlier, Pakistan surprisingly rested the frontline pace pair of Umar Gul and Mohammad Asif in three changes to the squad.

South Africa remained unchanged from Tuesday's seven-wicket win at Multan.

The tourists also won the first match by 45 runs in Lahore. Pakistan came back strongly to win the second by 25 runs and third by six wickets.

An inspired comeback by South Africa overshadowed Shoaib Akhtar's return to the Pakistan side as the tourists clinched the one-day series Monday, winning the final game by 14 runs.

Akhtar, playing his first one-day international for 13 months, took 4-43 to restrict South Africa to 233-9 in 50 overs but the tourists pulled off a sensational victory from the jaws of defeat by dismissing Pakistan for 219 in 46.3 overs.

South Africa bowled well and fielded sharply to win the five-match series 3-2.

Paceman Albie Morkel finished with 4-44 and Makhaya Ntini grabbed 4-61 as the tourists took six Pakistan wickets for just 20 runs off 36 balls to achieve a sensational win.

South African captain Graeme Smith was euphoric.

"It is fantastic to win both Tests and one-dayers and this was an incredible win. We took huge catches and the ball swung in the end and helped us to take those last wickets," said Smith.

Pakistan were cruising at 149-2 with Younis Khan (58) and Mohammad Yousuf (53) adding a solid 106 runs for the third wicket. They repaired the innings after Pakistan lost Imran Nazir (17) and Kamran Akmal (24).

Ntini removed both the openers in an incisive spell of five overs, having Nazir caught behind in the fourth over before bowling Akmal in the eighth.

Younis hit seven boundaries during his 65-ball knock before holing out to deep square-leg off Shaun Pollock.

Yousuf, who had scores of 53, 117, 58 and five in the series, soon followed as he edged Jean-Paul Duminy to wicket-keeper Mark Boucher. He hit five boundaries during his 88-ball knock.

With Younis and Yousuf gone in the space of four overs, the tourists sensed victory but captain Shoaib Malik (23) and Misbah-ul Haq (19) took the total to 199 before Albie Morkel removed both to bring the tourists back into contention.

With just 35 runs needed in the last 10 overs Pakistan panicked, with Morkel removing Malik, while Ntini dismissed Haq to expose the tail.

Ntini also removed the dangerous Shahid Afridi (nine), out to an excellent catch at deep by AB de Villiers. Morkel then dismissed Sohail Tanveer, Rao Iftikhar and Shoaib Akhtar -- all without scoring -- to win the match.

Pakistan captain Malik deplored the batting collapse.

"We could not finish the match which we dominated and it all boiled down to poor batting. A win would have been good for the Indian tour," said Malik of the forthcoming tour starting later this week.

Earlier, Akhtar, whose last one-day international was against England in September 2006, was ably supported by fellow paceman Rao Iftikhar (3-45) in South Africa's innings.

Jacques Kallis topscored with 86, with Herschelle Gibbs (54) and Duminy (44) also chipping in with useful contributions.

Akhtar missed the earlier two Tests and first four one-dayers as part of a 13-match ban for disciplinary lapses, including hitting teammate Mohammad Asif with a bat ahead of the Twenty20 world championship last month.