|Harbhajan Singh celebrates the last wicket of Morne Morkel as India retain the top spot [AFP]
India retained their number one Test ranking after off-spinner Harbhajan Singh took five wickets to force a series-levelling victory over South Africa in the second and final Test at Eden Gardens in Kolkata.
India claimed the dramatic win in the last minutes of the game, winning by an innings and 57 runs.
That big margin disguised the nerve-racking ending to the Test as the visitors got within touching distance of a draw, losing the last wicket with only 13 minutes of play remaining.
South Africa's Hashim Amla was named man of the match and man of the series, finishing not out for 123 in the last innings and ending the series with an astonishing average of 494, after making 253 not out in the first Test and 114 in the opening innings of this match.
The 26-year-old from Durban battled for 394 deliveries and struck 16 boundaries in his ninth Test century, but failed to prevent his team from snatching a thrilling draw.
He lost his more accomplished batting partners at regular intervals on the final day, but shared some lucrative stands with the tail enders to push his team toward a draw that would have delivered a series victory and that No1 spot in the rankings.
Mahendra Singh Dhoni's Indians, who lost the first Test in Nagpur by an innings and six runs, retained their No1 ranking with 124 rating points.
Second-ranked South Africa were left on 120 points.
Harbhajan Singh (5-59) claimed the final wicket, trapping Morne Morkel lbw, prompting the Eden Gardens crowd to erupt in celebrations.
"From this match, we have learnt that if we fight till the last, we will do special things," Harbhajan said.
"We were all ready for the fight, knew it was a very important game for all of us."
"We were all ready for the fight, knew it was a very important game for all of us. It is no fluke to be at the top."
Last man Morkel had hung on valiantly, facing 60 balls as he and Amla batted for 76 minutes in their brave but ultimately fruitless 10th-wicket stand.
The Proteas scored 290 in their second innings after 296 in their first, compared to India's 643-6 declared in their sole innings.
After the Indian celebrations, many players congratulated the disappointed Amla.
South Africa, aided by regular rain intervals on day four as they sought to grind out a draw, resumed the final day at 115-3.
As the South Africans fought hard, India sorely missed pace spearhead Zaheer Khan, who was confined to the dressing room the entire day with a knee injury
With time at the crease more crucial than runs, South Africa's very patient innings received two setbacks in the opening session, as Ashwell Prince and AB de Villiers both fell.
Prince (23) was beaten in the flight by a Singh delivery that dipped, and he ballooned a catch to Ishant Sharma at mid-off.
That was soon followed by the removal of de Villiers, who did not pick Amit Mishra's googly, played down the wrong line and was out for a clear lbw.
South Africa first innings 296
India first innings 643-6d
South Africa second innings
G Smith lbw b Mishra 20
A Petersen c Badrinath b Harbhajan 21
H Amla not out 123
J Kallis c Dhoni b Mishra 20
A Prince c Ishant b Harbhajan 23
AB de Villiers lbw b Mishra 3
JP Duminy lbw b Harbhajan 6
D Steyn lbw b Harbhajan 1
W Parnell c Harbhajan b Ishant 22
P Harris c (sub) Karthik b Ishant 4
M Morkel lbw b Harbhajan 12
Extras (b6 lb5 w1 nb18 penalty 5) 35
Fall of wickets: 1-36 2-54 3-111 4-158 5-164 6-172 7-180 8-250 9-264.
India's victory push gained further momentum in the middle session when Singh's slider pushed Jean-Paul Duminy (6) back on his crease, and he played for the nonexistent spin and was out lbw.
Dale Steyn (1) went in similar fashion, playing and missing at a Singh delivery that rapped him on the pad and was plumb lbw.
At 180-7, South Africa looked like folding, but Wayne Parnell (22) was resolute in his defence, sticking with Amla for 101 minutes.
He finally went soon after tea, delivering a catch to Singh at short mid-on off the bowling of Sharma.
Paul Harris (4) took up the role of support act, and held out for 36 minutes before edging a Sharma delivery to substitute fielder Dinesh Karthik at third slip.
That brought to the crease Morkel (12), who batted with such unusual assurance for a No.11 that Amla made little attempt to farm the strike, and the paceman responded well before playing outside the line on the final delivery.
"If you look at recent stats and recent records of teams that have come here not many teams have been able to push India like we have been able to push them," South Africa captain Graeme Smith said.
"So that is a positive for us and the credit to our character.
"It was an incredible effort from Morne (Morkel) and Hashim (Amla) and Wayne (Parnell) who put together partnerships.
"The game could have been easily over just after tea where we were sitting. If anything, we created pressure on India. Us coming into the series they had everything to lose and we had everything to gain."
The Indian cricket board said in a statement that paceman Zaheer Khan will not feature in the one-day series against the Proteas which starts on Sunday.
Smith will also miss the one-dayers due to a fractured finger and all-rounder Jacques Kallis will lead the tourists in his absence, the team management said.
The internationals will be played in Jaipur (February 21), Gwalior (February 24) and Ahmedabad (February 27).