Vernon Philander claimed 3-26 as South Africa won the third one-day international against Pakistan by four wickets at Centurion.
Pakistan had already clinched their maiden ODI series victory over South Africa with victories in the first two games but their quest for a series sweep started badly when they were bowled out for 179 in 46.5 overs after being sent in.
South Africa's bowlers all took at least one wicket; Philander, a swing specialist making a rare limited-overs appearance for his country, was well supported by fellow seamers Lonwabo Tsotsobe (2-38) and Ryan McLaren (2-28), while leg-spinner Imran Tahir finished with 2-56.
Pakistan captain Misbah-ul-Haq played a lone hand with 79 not out, at least giving his bowlers something to work with.
South Africa - who were without experienced trio Graeme Smith, Jacques Kallis and Dale Steyn - were always on course after opener Hashim Amla's 41 off 48 balls.
After Amla was run out and Pakistan spinner Saeed Ajmal picked up 2-34 from his 10 overs, it was left to home skipper AB de Villiers to steer his side across the winning line in the 39th over with 48 not out.