Ishant Sharma and Jasprit Bumrah sparked a dramatic collapse as India beat South Africa by 63 runs on the fourth day of the third and final Test at the Wanderers.
The win means India have retained the ICC Test Championship mace and have also won an award of $1million for being top of the rankings by the April 3 cut-off date. The victory in Johannesburg means second-placed South Africa can't go ahead of India, even if they beat Australia 4-0 in their upcoming series.
Dean Elgar and Hashim Amla shared a century second-wicket partnership on Saturday that took South Africa more than halfway towards their target of 241 before Amla's dismissal for 52 started a collapse in which nine wickets fell for 53 runs.
Sharma and Bumrah claimed two wickets each to start the slide before Mohammed Shami ripped through the lower order, taking 5-28.
Elgar was left to fight alone, carrying his bat for 86 off 240 balls.
"This is one of our sweetest wins," skipper Virat Kohli said. "This day will be remembered for a long time for us as a team."
"We already had the belief but now we have the result to back that as well.
"South Africa played better than us in the first two games so they deserved to win (the series) but we deserved to win this game. But at many moments in the first two games we put them under pressure.
"We are the number one team in the world and we certainly played like that today."
South Africa captain Faf du Plessis admitted that India had been the better team at the Wanderers but hailed the series win.
"It’s fantastic to win the series against a really good team. Credit to India for playing some really good cricket in all three Tests."
The hosts were looking comfortable as Elgar and Amla compiled a partnership of 119, although it took four hours and 50.4 overs of hard work on a difficult pitch. It was only the third century partnership of the series.
But India hit back with the wickets of Amla and AB de Villiers in quick succession shortly before tea.
Amla fell with the total on 124 when he clipped Sharma firmly towards midwicket and Hardik Pandya dived to his right to hold a good catch. Amla had faced 140 balls in making his second half-century of the match.
De Villiers started confidently with a boundary off Sharma but was out for six when he was squared up by a lifting delivery from Jasprit Bumrah that flew off the shoulder of his bat to Ajinkya Rahane at gully.
The same two bowlers struck again immediately after tea. South African captain Faf du Plessis was bowled by a ball from Sharma that cut back and kept low and the out-of-form Quinton de Kock was trapped leg before wicket first ball by Bumrah.
Vernon Philander batted brightly to make 10 before he pulled a ball from Shami onto his stumps, to be followed in quick succession by Andile Phehlukwayo, Kagiso Rabada and Morne Morkel, all without scoring. Phehlukwayo was bowled by Shami, Rabada was caught at first slip by Bhuvneshwar Kumar and Morkel was bowled by Shami.
Elgar, having batted with unflappable concentration for more than five hours, tried to play some shots and keep the strike after being joined by last man Lungi Ngidi. He hit a six off Kumar before Ngidi was caught behind off Shami.
Conditions remained difficult for batting but there were none of the extreme bounces and deviations that prompted the umpires to halt play shortly before the scheduled close on Friday.
But once the Elgar-Amla partnership was broken new batsmen were unable to play with any confidence.
ICC TEST RANKINGS
1) India - 121
2) South Africa - 115
3) Australia - 104
4) New Zealand - 100
5) England - 99
6) Sri Lanka - 94
7) Pakistan - 88
8) West Indies - 72
9) Bangladesh - 72
10) Zimbabwe - 1
Qantas tour of South Africa
Australia squad: Steve Smith (c), David Warner (vc), Cameron Bancroft, Jackson Bird, Pat Cummins, Peter Handscomb, Josh Hazlewood, Jon Holland, Usman Khawaja, Nathan Lyon, Mitchell Marsh, Shaun Marsh, Tim Paine, Jhye Richardson, Mitchell Starc.
Warm-up match v SA Invitational XI, Sahara Park, Benoni, Feb 22-24
First Test Kingsmead, Durban, March 1-5
Second Test St George's Park, Port Elizabeth, March 9-13
Third Test Newlands, Cape Town, March 22-26
Fourth Test Wanderers, Johannesburg, March 30-April 3