Quinton de Kock made a magnificent century South Africa won a dramatic third ODI by four runs against India at Newlands to seal a 3-0 series whiteewash.

Half-centuries from Shikhar Dhawan (61) and Virat Kohli (65) gave the tourists a platform to build their chase of 288 from, but some excellent bowling and safe hands in the field saw the Proteas dismiss India for an agonising 283 off the second ball of the final over.

India won the toss and put South Africa in to bat, taking the early wickets of Janneman Malan (1) and Temba Bavuma (8). When Aiden Markram fell to Deepak Chahar for 15 in the 13th over, the hosts were 70-3 and wobbling until a partnership of 144 between De Kock and Rassie van der Dussen.

De Kock followed up his 78 from the second game in Paarl to by making a classy 124 off 130 balls, with Van der Dussen (52) the only other to make a half-century for the Proteas.

However, both fell in consecutive overs, and though a useful pairing of David Miller (39) and Dwaine Pretorius (20) put on a partnership of 44, South Africa were all out in the last over, with Prasidh Krishna (3-59) bringing the innings to a close with the penultimate ball for a total of 287.

The chase did not start brilliantly for India as KL Rahul was caught by Malan off the bowling of Lungi Ngidi (3-58) for just nine, though Dhawan and Kohli set about repairing that early damage.

Their partnership of 98 appeared to set the tourists on their way to a consolation win, though after Dhawan was dismissed when he hit an Andile Phehlukwayo delivery straight up in the air, allowing De Kock to snaffle the catch, Rishabh Pant was out first ball to Phehlukwayo and India's chase looked less assured.

Kohli steadied the ship with Shreyas Iyer (26) before he was taken by Bavuma off the bowling of Keshav Maharaj, but Suryakumar Yadav (39) and Chahar (54) had India scenting a win.

However, with just 10 runs required for victory, Chahar hit Ngidi straight up in the air, with Pretorious taking the catch, before Jasprit Bumrah (12) was caught by Bavuma off Phehlukwayo to leave India needing seven runs from nine balls with one wicket remaining, which fell when Yuzvendra Chahal (2) hit Pretorious straight to Miller.

Proteas in safe hands with Bavuma

It is safe to say that South Africa's ODI captaincy is in safe hands, quite literally when it comes to Bavuma as he took four catches to help his team dismiss India in Cape Town.

Bavuma also used his bowling attack expertly, with five different bowlers sharing the wickets (Ngidi and Phehlukwayo with three, Pretorius two and Sisanda Magala and Maharaj getting one each).

One day woes for India

Although the first two defeats in this series were the result of poor performances, this was a much tighter affair and stand-in ODI captain Rahul will be pleased with the improvement.

Chahar was one success story, coming in for his first game of the series and hitting 54 with the bat while taking two wickets with the ball, but this now makes it four defeats on the spin in ODIs.