Centuries from openers Quinton de Kock and Hashim Amla have guided South Africa to a seven-wicket victory over England that keeps alive their hopes of winning the five-match series of one-day internationals.

Joe Root made a sparkling 125 as England, after winning the toss and electing to bat, piled up 8-318 in 50 overs.

De Kock (135) and Amla (127) then amassed 239 for the first wicket to lay the platform before South Africa reached the target with 22 balls to spare to cut their series deficit to 2-1.

England, seeking to become the first touring team to win a test and ODI series in South Africa for 14 years, will now bid to clinch overall victory in Johannesburg on Friday.

De Kock, aged 23 years and 54 days, was particularly brutal as he became the youngest player in history to record 10 ODI hundreds, surpassing the record of Indian star Virat Kohli (23 years and 159 days). He achieved the feat in just his 55th innings, smashing Kohli's previous mark of 80 innings.

Do Kock notches his 10th ODI century // Getty Images

The left-hander also made an unbeaten ton in the first game in Bloemfontein.

Quick Single: Kohli on track to emulate Tendulkar

Amla cut and pulled his way to a 22nd ODI century, and third in a row at Centurion Park.

Earlier, Root eased to his seventh ODI century with a masterful display of power and placement, hitting 10 fours and five sixes.

Root added 125 for the second wicket with opener Alex Hales (65) and 82 for the fifth with Ben Stokes (53) before being run out following a calamitous mix-up with the latter.

Paceman Kyle Abbott took 2-50 and was the only South African bowler to keep his economy rate under six an over.