Risbah Pant cracked a sizzling century for India in the third and final Test at Newlands on Thursday as South Africa were set a tricky victory target of 212.
The Proteas finished 101-2 at the close of Day 3 in Cape Town, 111 runs short of clinching the match and a series that is tied at 1-1.
Pant made 100 not out off 139 balls, hitting six fours and four sixes, but received minimal support from his teammates as India were bowled out for 198. Only KL Rahul (10) and Virat Kohli (29) managed to reach double figures.
South African captain Dean Elgar, star of a similar chase in the second Test in Johannesburg, looked set to see out the day in partnership with in-form Keegan Petersen but fell for 30 to a diving leg side catch by Pant off Jasprit Bumrah in the last over of the day.
Out-of-form opener Aiden Markram made 16, all from boundaries, but was then caught sharply at third slip by KL Rahul.
Having escaped with an extravagant drive which flew between third slip and gully, Markram repeated the shot against the next ball and was out with the total on 23.
Petersen, South Africa's top-scorer with 72 in the first innings, was unbeaten on 48 and looked in great touch for what looks set to be a tense deciding day.
Pant, batting with unorthodox flair, ran out of partners in a poor Indian batting performance but was able to notch his fourth Test century before the last wicket fell.
Indian captain Kohli produced an unusually subdued knock, batting for more than three hours and facing 143 balls but the next highest contributor to the total was 28 extras.
Left-arm fast bowling discovery Marco Jansen took 4-36 — his third four-wicket haul in three Tests — while Kagiso Rabada (3-53) and Lungi Ngidi (3-21) took the other six wickets.