Anil Kumble almost forced a result in a thrilling final session of the third and final Test between India and Pakistan in Bangalore, but the tourists clung on for a draw to go down just 1-0 in the series against their fierce rivals.
India's huge first innings total of 626 had all-but sealed a series victory for the hosts, with Pakistan needing almost a miracle to engineer a victory from that position.
Starting the final day with an 89-run lead, India batted on to 284-6 declared to leave Pakistan chasing an unlikely 374 to win off just 47 overs.
Meandering along on 23-0 at tea, a draw seemed to have been accepted, but a five-wicket burst from India skipper Kumble saw Pakistan stumbling.
Yuvraj Singh added two wickets and the tourists were on the brink of an embarrassing defeat, before bad light came to their rescue.
Pakistan would have had a further 11 overs to face to avoid a humiliating loss, but in the end they closed on 162-7 and a draw was salvaged, although the series was lost 1-0.
India looked in no mood to throw away their 1-0 series advantage, and were willing to sacrifice any chance of winning the final Test by taking the game completely away from the tourists.
For that reason India batted on in the morning from a position of 131-2, with Sourav Ganguly hitting 91 to add to his sublime 239 in the first innings, while Dinesh Karthik contributed 52.
The declaration finally came on 284-6, thought to be much too late for a result to be forced with Pakistan set the improbable target of 374 to win off 47 overs.
Pakistan's openers had made comfortable progress to 44-0 before what looked a certain draw was almost turned into a memorable win by Kumble.
Two quick wickets made it 44-2, before Salman Butt's dismissal made it three for India, and Kumble - who started to think the impossible victory could be achieved.
Misbah-ul-Haq and Faisal Iqbal added 73 at seven runs an over as Pakistan tried to hit their way out of trouble with India's fielders crowded around the bat looking for wickets - and wickets they got.
Iqbal went for 51 and when Kamran Akmal went first ball to complete Kumble's five-for, the Pakistan wobble had turned into a real crisis.
Yuvraj then got rid of Misbah before Yasir Arafat went for a duck and with seven wickets down the tourists looked in real danger of suffering a hugely damaging defeat.
In the end, India's own late declaration cost them as, with playing conditions not allowing the use of floodlights, bad light brought an early end to proceedings and Pakistan's blushes were spared.
They still had to stomach a series defeat against their greatest rivals however, and India's win sends them into the upcoming clash with Australia in great heart.