Top-ranked India were fighting for a draw after losing two wickets on the final day of a high-scoring first Test against England in Rajkot on Sunday.
England declared their second innings at 260-3 shortly after lunch, leaving the top-ranked home side to chase 310 runs off 49 overs on the fifth day.
But the Indians looked more concerned with survival on a wearing track at the Saurashtra Cricket Association ground, hosting its first Test ever.
At tea, India were 49-2 off 18 overs, needing 261 runs with eight wickets in hand for an unlikely win in the final session of the match.
Murali Vijay (29), who hit a century in India’s first innings score of 488, and skipper Virat Kohli (two) were the not out batsmen at the crease.
The Indians lost Gautam Gambhir to Chris Woakes for a duck while Cheteshwar Pujara (18) was trapped leg before wicket by spinner Adil Rashid.
The visitors owed their dominant position to captain Alastair Cook (130) and teenage debutant Haseeb Hameed (82) who shared 180 runs for the opening wicket ─ a record opening stand for England in India.
It was the 30th Test century for the left-handed Cook and record fifth in India, more than any overseas batsman.
Hameed, 19, belied his tender years in making 82 off 177 balls that contained one six and seven boundaries.
His knock was the highest Test score by a teenager for England, beating Jack Crawford’s 74 in Cape Town in 1906.
Cook and Hameed started out cautiously, but opened up to play some delightful shots on both sides of the wicket in batsmen-friendly conditions.
India finally tasted success when leg-spinner Amit Mishra took a sharp return catch as Hameed tried to go for a slog sweep.
Hameed, nicknamed “Baby Boycott” for his unflappable batting technique, had scored a stylish 31 during England’s first innings.
The right-hander is Cook’s 10th different opening partner since the retirement of Andrew Strauss in 2012 and on this form could be the long-term solution at the top of the order.
England had made 537 in their first innings after winning the toss, thanks to centuries from Joe Root, Moeen Ali and Ben Stokes.