(CNN) -- India remained the top Test playing country in the world after forcing a dramatic innings and 57 runs victory over closest rivals South Africa in the second Test in Kolkata on Thursday.
With only nine balls of the scheduled allocation in the last hour remaining, off-spinner Harbhajan Singh trapped Morne Morkel leg before wicket to spark wild scenes of celebration at Eden Gardens.
Harbhajan, who took five wickets for 59, embarked on a victory charge, pursued by teammates who had been frustrated by a 124-ball last wicket stand between tailender Morkel and the brilliant Hashim Amla, who hit his ninth Test century.
Amla remained unbeaten on 123 to finish the series with an incredible average of 490 after making scores of 253 not out as South Africa won the first Test and 114 in the first innings of the latest match.
His peerless batting gave Graeme Smith's men hope after they trailed by 347 runs on first innings, needing a draw to stay as world number one in the rankings ahead of India.
After the rain-hit fourth day, India whittled their way through the South African batting despite being without injured paceman Zaheer Khan.
But the last wicket stand looked set to deny them victory until Harbhajan pushed through a faster ball to remove Morkel for a defiant 12.
"It was a great win considering we had just three bowlers left to do the job," said Indian captain Mahendra Singh Dhoni as the trophies were presented.
"Harbhajan and the others bowled so well that we desperately wanted to be on the winning side."
Amla, who barely gave a half-chance in his superb batting in the two Tests,was named man of the series.
A three-match one day series now follows between the two sides.
Meanwhile, Bangladesh are facing defeat heading into the final day of the one-off Test against New Zealand in Hamilton.
The Kiwis declared their second inning on 258 for five just after tea on the fourth day to set the tourists a victory target of 403.
They then made major inroads into the Bangladesh batting, taking five wickets with just 88 runs scored.
Daniel Vettori with two for 23 led the bowlers to leave Bangladesh needing 316 on the final day but with most of the top batsmen in the pavilion.