Quinton de Kock scored a superb century as South Africa completed a clean sweep of their three-match one-day international series against India.
Rishabh Pant scored a brilliant ton for India but hosts South Africa made strides towards winning the final Test and the series after closing on 101-2 in pursuit of 212.
Jasprit Bumrah snared his seventh Test five-wicket haul as India earned a first-innings lead over South Africa in Cape Town.
Dean Elgar hit an unbeaten 96 as South Africa sealed a superb seven-wicket victory against India to level the Test series at 1-1 in Johannesburg.
South Africa collapsed on the final day of the first Test at Centurion as India won by 113 runs to draw first blood in the three-match series.
Mohammed Shami claimed his 200th Test wicket with figures of 5-44 to earn India a healthy advantage against South Africa on day three at Centurion.
KL Rahul struck his seventh Test century to guide India into a strong position on the opening day of the first Test against South Africa at Centurion.
India will tour South Africa for three Tests and three ODIs but have postponed four Twenty20 internationals to a later date.