India claimed a sensational consolation victory in the third and final Test at the Wanderers, dramatically tearing through South Africa's batting line-up to triumph by 63 runs on Saturday.
Chasing 241, the Proteas reached 124-1 shortly before tea, only to then slump to 177 all out with four batsmen making ducks as Dean Elgar was left stranded on 86 not out.
Mohammed Shami (5-28) led India's wicket-takers, supported by Ishant Sharma (2-31) and Jasprit Bumrah (2-57).
Although the tourists had already lost the three-match series after suffering defeats in Cape Town and Centurion, the victory preserves India's unbeaten record in Johannesburg, where they have won two and drawn three of their five Tests since first playing at the venue in the longest format in 1992.
The completion of the match had appeared in doubt when dangerous inconsistencies in the surface prompted the umpires to halt play ahead of schedule for safety reasons late on day three.
The decision was taken, though, to press on with the contest, although a damp outfield caused by rain forced a delayed start on Saturday.
Somewhat surprisingly, the pitch initially offered little assistance to the bowlers after South Africa resumed on 17-1.
Elgar, who had been hit on the head with what proved the final delivery of the previous day, looked in good touch as he put on 119 for the second wicket with Hashim Amla (52).
South Africa looked likely to reach their target as Elgar and Amla prospered, but two crucial wickets then fell late in the afternoon session.
Ishant dislodged Amla thanks to a superb diving catch from Hardik Pandya and AB de Villiers (6) departed just three overs later, the former captain edging Bumrah to Ajinkya Rahane.
Players take tea with #TeamIndia striking back this session with the priced wickets of AB de Villiers & Hashim Amla.-- BCCI (@BCCI) January 27, 2018
Dean Elgar pushing along as South Africa are now 136/3 needing 105 to win. India 7 wkts away. I Sharma 1/27, J Bumrah 1/46 #SAvIND#TeamIndiapic.twitter.com/JcEJ4Fe1HY
Things got much worse for South Africa after tea as skipper Faf du Plessis (2) was bowled by an Ishant delivery that cut back in off the seam and kept low.
The departure of Du Plessis triggered a woeful collapse, the Proteas losing five wickets in the space of nine overs, adding just 17 runs in that time.
Vernon Philander made 10 before becoming Shami's first victim of the day, chopping onto his own stumps while attempting an ill-advised pull shot.
Bumrah had already trapped Quinton de Kock lbw for a duck by that stage, while Andile Phehlukwayo, Kagiso Rabada and Morne Morkel also came and went without scoring.
Shami completed his five-wicket haul and South Africa's demise was confirmed when the Decision Review System showed Lungi Ngidi (4) had edged behind.
Attention now shifts to six one-day internationals and three Twenty20 internationals, with the first 50-over match due to take place in Durban on Thursday.