Pakistan were bowled out for 219 in 46.3 overs at the Gaddafi stadium with Albie Morkel taking 4-44 and Makhaya Ntini 4-61.
Younis Khan (58) and Mohammad Yousuf (53) had shared a third-wicket partnership of 106 in 134 balls to provide a solid platform but Pakistan lost their last six wickets in 36 balls. South Africa clawed their way back after Younis was caught at deep mid-wicket by Morkel off Shaun Pollock in the 30th over. Three overs later part-time spinner Jean-Paul Duminy had Yousuf slashing at a wide ball to be caught behind.
Captain Shoaib Malik then went for 23 before Misbah-ul-Haq (19), Shahid Afridi (9) and Sohail Tanvir, Rao Iftikhar and Shoaib Akhtar, who all failed to score, were undone by the swinging ball and some brilliant catching in the outfield.
Lesson in chasing
"We played 90 percent better cricket. The total was chaseable. We have learnt today what we need to do how to finish a game," Malik said.
Earlier, Pakistani strike bowler Akhtar made a dramatic return to international cricket by grabbing four wickets.
The controversial paceman, back in the side after a 13-match ban for his first one-dayer since September 2006, bowled with fire to trouble South Africa's batsmen on a slow pitch, taking four for 43. Paceman Rao Iftikhar supported him well to claim 3-45, his third three-wicket haul in the series.
Jacques Kallis top-scored with 86 to anchor the innings after the visitors chose to bat first with opener Herschelle Gibbs hitting 10 fours in his rollicking 54.
Score board
SOUTH AFRICA
Gibbs b Iftikhar 54
Smith b Akhtar 0
Kallis c Malik b Akhtar 86
De Villiers c Nazir b Malik 17
Duminy c Akmal b Iftikhar 44
Boucher c Malik b Akhtar 5
Pollock c Tanvir b Iftikhar 2
Morkel b Akhtar 5
Botha b Tanvir 0
Nel (not out) 3
Ntini (not out) 3
Extras (LB-4, W-6, NB-4) 14
Total (for 9 wkts, 50 overs) 233
Fall of wickets: 1-7, 2-87, 3-119, 4-194, 5-202, 6-205, 7-226, 8-226, 9-230.
Bowling: Akhtar 9-0-43-4, Sohail Tanvir 6-0-38-1, Rao Iftikhar Anjum 10-0-45-3, Shahid Afridi 10-0-44-0, Rehman 10-0-36-0, Malik 5-0-23-1.
PAKISTAN
Nazir c Boucher b Ntini 17
Akmal b Ntini 24
Younis c Morkel b Pollock 58
Yousuf c Boucher b Duminy 53
Malik b Morkel 23
Misbah c Duminy b Ntini 19
Afridi c De Villiers b Ntini 9
Tanvir lbw Morkel 0
Rehman (not out) 7
Iftikhar c Boucher b Morkel 0
Akhtar c Nel b Morkel 0
Extras (LB-2, W-7) 9
Total (all out, 46.3 overs) 219
Fall of wickets: 1-22, 2-43, 3-149, 4-160, 5-199, 6-209, 7-209, 8-219, 9-219.
Bowling: Pollock 9-0-34-1, Ntini 9-0-61-4, Nel 10-1-32-0, Morkel 8.3-0-44-4, Jacques Kallis 3-0-15-0, Johan Botha 6-0-25-0, Jean Paul Duminy 1-0-6-1.