Hashim Amla and AB de Villiers scored centuries as South Africa beat Pakistan by 34 runs in a highly-entertaining third ODI in Johannesburg.
The pair shared a record third-wicket stand of 238 and rattled along at 7.84 an over, as the hosts piled up 343-5 after being asked to bat first by the tourists.
Such a total seemed unlikely when South Africa managed a paltry 26 runs off the first 10 overs but, after coming together at 42-2, Amla and de Villiers pressed the accelerator and took the home side up to 280 before the former was caught at extra cover off Wahab Riaz for 122.
De Villiers followed soon after for 128 while Faf du Plessis added further late impetus with a quickfire 45 from 28 balls, including 20 from one Wahab over.
It left Pakistan needing to equal their highest total batting second in any ODI and it looked a lost cause when they slumped to 132-5 halfway through the 25th of their 50 overs.
However, they were given brief hope by an extraordinary burst of hitting from Shahid Afridi.
The number seven smashed seven sixes and fives fours in a whirlwind 48-ball 88 which helped Pakistan to 244-6.
But when he was caught at long-off by Ryan McLaren off Lonwabo Tsotsobe, South Africa regained their grip on the game.
Wahab tried his best to keep the chase going but he was eventually last man out for 45, clean bowled by Rory Kleinveldt with the first ball of the 49th over.
The result leaves Pakistan needing to win the remaining two matches to take the five-match series.