South Africa reinforced their status as the world's number one Test team when they beat Pakistan by four wickets on the fourth day of the second Test at Newlands on Sunday.
The victory, with a day to spare, gave South Africa a winning 2-0 lead in the three-match series and came after a dramatic Pakistan collapse in their second innings.
It was South Africa's fifth successive Test win, their sixth successive series victory and extended their unbeaten run in Tests to 14 matches going back more than a year.
"It was one of the more rewarding wins we have had," said South Africa captain Graeme Smith.
"We were under pressure (at the start of) day three and we needed two days of big performances. To get those performances was incredible."
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 either side of lunch. At one stage four wickets fell in 13 balls, including three off successive deliveries.
The collapse was engineered by man of the match, left-arm spinner Robin Peterson, and opening bowler Vernon Philander who took three wickets each before Dale Steyn finished off the innings.
Peterson finished with three for 73 and Philander followed up his first innings five for 59 by taking four for 40.
The result was a disappointment for Pakistan, who were on top after two days before a strong fightback by South Africa's lower order batsmen on Saturday.
Pakistan captain Misbah-ul-Haq said Peterson's innings of 84 on Saturday was "the game changer -- a lead of 70 or 80 runs on the first innings would have been very important."
Smith added: "Robbie was inspirational. To get as close as possible to their (first innings) total was going to be the key."
Pakistan off-spinner Saeed Ajmal took four for 51 in South Africa's run chase to finish with match figures of 10 for 147.
"He is a world-class bowler," said Misbah, who felt that Ajmal's performance showed that Pakistan might have had a chance of winning if the target had been 70 or 80 runs more.
"The pressure is different when you are chasing 250," he said.
Smith said of Ajmal: "He's the number one spinner in the world."
"It's not often in South Africa that a spinner plays such a dominating role. From a conditions point of view it was not ideal. It was not what we were expecting in South Africa but we've got to play on what we are given. To come through in these conditions is big for us."
Set to make 182 to win, South Africa lost Alviro Petersen 10 runs into their chase, when he was leg before wicket to Umar Gul for one.
Smith and Hashim Amla put on 53 for the second wicket before Smith was leg before to Ajmal for 29 shortly before tea.
Ajmal gained a second leg before decision when he dismissed Jacques Kallis for 21.
Amla (58) and De Villiers (36) shared a rapid 62-run partnership for the fourth wicket before both batsmen perished playing attacking shots.
Faf du Plessis became Ajmal's 10th victim of the match before Dean Elgar hit the winning run.
Pakistan made slow but solid progress at the start of the day.
But they had only added 14 runs in 8.2 overs to their overnight total when Misbah top-edged a sweep against Peterson and was caught by Smith at short fine leg for 44. "My shot was a turning point," he admitted.
Misbah said that although Pakistan had played better than in the first Test in Johannesburg, where they lost by 211 runs, they had made costly mistakes.
"We blame ourselves. We made mistakes. You can't do that against the top side in the world," he said.
Azhar Ali and Asad Shafiq added 33 for the fifth wicket before Shafiq was unlucky to see a defensive stroke against Philander bounce up and then back on to his stumps.
The wicket fell five overs after the umpires called for a replacement ball after the original ball went out of shape.
Peterson bowled Sarfraz Ahmed with the last ball of the next over. Philander then dismissed Azhar Ali, who made a patient 65, and Umar Gul with the first two balls of the following over.