South Africa 319 for 3 (de Kock 135, Amla 127) beat England 318 for 8 (Root 125, Hales 65, Stokes 53) by seven wickets
Scorecard and ball-by-ball details
A century of the highest class from Quinton de Kock helped South Africa complete the highest successful run chase in an ODI at Centurion and keep the series against England alive.
With England having won the first two games in the five-match series, South Africa required a win to sustain their hopes of avoiding their first double defeat - in the Test and ODI sections of a tour - at home for 14 years.
But when they conceded 318 it left them requiring a record run chase at this ground on a pitch that had appeared cracked and two-paced during the England innings.
Yet they made light of their target, with an opening stand of 239 in 36.5 overs between de Kock and Hashim Amla racing them to victory with seven wickets and 22 deliveries remaining. They made it appear easy.
It is a pretty special batting performance that eclipses a century from Amla, but so sweetly did de Kock time the ball, so wide was his range of stroke, so little margin for error did he allow the bowlers that a pitch on which few England batsmen looked comfortable was made to appear something approaching a batting paradise.
The statistics of his de Kock's career are worth dwelling upon for a moment. Despite only celebrating his 23rd birthday in December, this was his 10th ODI century in his 55th match. To put that in perspective, nobody has reached the milestone at a younger age (Virat Kohli was the previous holder of that record) and it is as many ODIs centuries as Graeme Smith managed in his entire 196-match ODI career.
England will be relieved South Africa did not select de Kock earlier in the Test series. He has now scored three centuries against them (one in the Centurion Test and two in this ODI series) in his last four international games.
Such is his ability, he forces bowlers to alter their natural length and then punishes the resultant full or short deliveries. Twice in the first over, he eased David Willey through the covers for four. Minutes later he was treating Reece Topley the same way and following it with a perfectly timed drive straight back past the bowler.
Moeen Ali's first delivery was delightfully late cut for four before he was slog-swept for six and when the seamers dropped short in search of a solution, they were pulled with dismissive power. One pick-up pull for six off a Chris Jordan delivery that was only fractionally short was probably the stroke of the day.
With both sides set to name their World T20 squads on Wednesday, there was food for thought here for England. Despite all the progress they have made, with their batting in particular, their bowling attack remains both green and a little lacking in pace. In conditions where there is little swing available, they lack the weapons to dislodge well-set batsmen. Steven Finn might have made a difference, but there may also be a temptation to recall Stuart Broad, an unused member of this ODI squad.
Amla was only marginally less impressive than de Kock. Using his crease to upset the line of the England bowlers, he stroked some balls off his off stump through midwicket and others through extra-cover. When the bowlers reacted by bowling wider of off stump, he unveiled that familiar, flowing drive that has featured in each of his 22 ODI centuries. Only AB de Villiers, with 23, has scored more for South Africa.
Earlier the biggest of Joe Root's seven ODI centuries took England to an apparently challenging total. By the time South Africa struck for the fourth time, they could have been quietly satisfied with their work. Jos Buttler, again promoted to No. 4 to build upon the strong start from England's top order, had fallen first ball clipping to an intriguingly placed leg gully, while Eoin Morgan had laboured for 24 deliveries over his eight runs.
But then Ben Stokes joined Root in a fifth-wicket stand of 82 in eight overs that took England's total from the average to the strong. While Root was not entirely fluent in the early stages of innings, so wide is his range of stroke and so impressive his fitness levels that even when he was struggling to find the boundary, he was accumulating steadily. His 125 was the highest ODI score made by an England batsman against South Africa.
Recognising that, once the shine had left the ball, the pitch became somewhat sluggish, Root started to skip down the pitch to hit the seamers off their length and over mid-on. With the bowlers struggling to hit upon a length that contained him, he punished the resulting short balls with one uppercut for six off Morne Morkel the stroke of the innings. Twice he thrashed full-tosses from Imran Tahir for six over mid-wicket.
He gave one chance, on 44, when de Kock was unable to lay a hand on a tough chance offered off the bowling of David Wiese - a dab to third man that went a little finer than Root intended - but that moment apart, it was another masterful innings by Root.
While de Kock went on to redeem himself, perhaps a key passage of play occurred far earlier. With seven overs and a delivery remaining of their innings, England had six wickets in hand, two batsmen well set and a target in excess of 330 in their sights.
But then Root was run-out following a mix-up with Stokes - Root's drive crashed into the stumps at the non-striker's end and, in the confusion, the pair were caught mid-pitch - and Kyle Abbott, in particular, bowled with control and skill to stall the charge. He dismissed Stokes and Jordan with successive deliveries and, in five overs up to the end of the 48th over, England added just 24 runs.
Such is the depth of England's batting, that even their No.9 and No.10 - two men with 12 first-class centuries between them - are capable of attacking and Adil Rashid and Willey struck a six apiece in plundering 25 from the final two overs. But perhaps that lost momentum in the final seven overs cost them dear.
Maybe Eoin Morgan will also reflect on his decision to bat first. de Villiers made no secret of his desire to bowl first, had he won the toss, and it did appear that conditions eased for batsmen as the lights came into play and the light dew allowed the ball to come on to the bat a little more readily.
Or it may just be that, as with the best innings, the quality of the batting made it seem that way. The sense remains that, whatever England did with the ball and whenever they bowled, on this form de Kock was too good for them.