South Africa moved into an unassailable 2-0 lead in their three-Test series against Pakistan as they completed a four-wicket triumph on the fourth day in Cape Town.
The win was down in no small part to a dramatic batting collapse from the tourists who lost their last seven second innings wickets for just 69 runs to leave South Africa chasing a victory target of 182.
Saeed Ajmal did his best to deny the hosts as he claimed four more wickets to add to the six he took in the first innings to end with match figures of 10-147.
However, it was not enough with Hashim Amla's half-century and a solid contribution from AB De Villiers (36) helping to ensure that the Proteas got over the line.
It was Vernon Philander and Robin Peterson who did the damage for South Africa in the morning session as they both took three wickets to rip through a Pakistan batting line-up that had resumed on 100-3, already 112 runs ahead.
Peterson got the ball rolling as he had Misbah-ul-Haq caught at short fine leg after a top-edged sweep for 44, while Philander's first wicket of the day was that of Asad Shafiq as he saw the ball spin backwards after hitting the ground and remove the off bail.
Peterson would also claim the scalps of Sarfraz Ahmed and Ajmal, while it was Philander who picked up top-scorer Azhar Ali (65) and Umar Gul before Dale Steyn wrapped up the innings for 169 as he had last man Mohammad Irfan caught in the slips.
South Africa's chase got off to a poor start as Alviro Petersen was trapped leg before by Gul for just one, but Graeme Smith and Amla steadied the ship with a second-wicket partnership of 63 before Ajmal had the Proteas skipper adjudged lbw.
Ajmal also removed Jacques Kallis after a review from the South African proved fruitless and then bowled Amla, although by that stage the home side needed only a further 32 runs to win.
Tanvir Ahmed picked up De Villiers and Faf du Plessis followed soon after as Ajmal claimed a fourth victim, but Dean Elgar eventually hit the winning run off Ajmal to see the job through.
Who will win the New Zealand v England Test series?