Pakistan were bowled out for 169 after starting the day on a relatively comfortable 100 for three. They lost their last six wickets for 22 runs on either side of lunch. At one stage four wickets fell in 13 balls, including three off successive balls.
The collapse was engineered by Robin Peterson and Vernon Philander, who took three wickets each before Dale Steyn finished off the Pakistan innings.
Peterson finished with three for 73 and Philander took four for 40. Saeed Ajmal took four for 51 in South Africa's run chase to finish with match figures of ten for 147.
Set to make 182 to win, South Africa lost Alviro Petersen early. Hashim Amla kept his cool and built small partnerships with Graeme Smith, Jacques Kallis and AB de Villiers to help Proteas to their sixth consecutive series win.
Brief scoresPakistan 338 and 169 (A Ali 65, Philander 4/40. South Africa 336 and 182/6 (H Amla 58, S Ajmal 4/51).