A phenomenal opening stand from Quinton de Kock and Hashim Amla ensured South Africa avoided a series defeat in the third one-day international against England at Centurion, winning by seven wickets.
De Kock and Amla's astonishing 239-run partnership powered the Proteas beyond the tourists' total of 318-8, keeping their hopes of winning alive by pulling the five-game series back to 2-1.
Joe Root notched an ODI career-best 125 to help England to a formidable score, but De Kock (135) and Amla (127) produced the second-highest stand for the first wicket in South Africa's ODI history to fire them to a much-needed victory.
Alex Hales backed up his 99 in the second game with 65 on this occasion, and Ben Stokes' brisk 53 from 37 balls propelled England beyond the 300-mark.
But the visitors' bowling attack had little answer to the superb stand between De Kock and Amla, as the Proteas retained their hopes of gaining a measure of revenge for a 2-1 Test series defeat earlier in the tour.
Having won the toss, England made a strong start but saw Jason Roy needlessly run out for 20 before Hales and Root added 125 for the second wicket.
The stand was ended when Hales lofted Kagiso Rabada (2-65) to long leg and Jos Buttler - a centurion in the first match at Bloemfontein - fell in the same over for a golden duck.
Captain Eoin Morgan (8 from 24) never found his rhythm but Root powered on and brought up his seventh ODI century off 95 deliveries, while Stokes provided strong support.
David Willey and Adil Rashid (both 13 not out) pushed England over the line, but South Africa's opening pair mounted a fantastic response.
De Kock instantly set the tone, hitting two fours off Willey (0-40) in the opening over, Amla replicating the feat shortly after.
The runs continued to come steadily as the opening pair breezed ahead of the rate, England's bowling attack providing little resistance as De Kock notched his 10th ODI century.
The formidable partnership was finally brought to an end when Rashid (1-45) ousted De Kock, whose wonderful innings included 16 boundaries and four maximums.
Although Moeen Ali (1-75) removed David Wiese for seven, Amla kept motoring on for his 22nd ODI century - his third successive ton at Centurion - before being caught behind off Chris Jordan (1-54).
That dismissal did little to check South Africa's victory charge, as Faf du Plessis notched an unbeaten 33 to fire the hosts to their target with 22 balls remaining.