Bangladesh battled to 253-8 at stumps on the fourth day of a thrilling Test in Chittagong on Sunday, needing 33 for their first-ever win against England.
Hopes of an historic Test victory rested with debutant Sabbir Rahman who was unbeaten on 59, after England set the hosts a target of 286 on a crumbling wicket.
Sabbir shared an 87-run stand with skipper Mushfiqur Rahim before England regained the initiative with three quick wickets in the final session.
Off-spinner Gareth Batty broke the late resistance with an awkwardly bouncing delivery that prompted skipper Mushfiqur (39) to give a catch to Gary Ballance at short leg.
Pace bowler Stuart Broad then found some reverse swing to remove Mehedi Hasan (one) and Kamrul Islam (0), putting England back in charge.
Batty finished the day with 3-65 while Broad claimed 2-26, but Sabbir kept Bangladesh in contention with a gritty innings that included three fours and two sixes.
“I think it has been a brilliant Test match,” Broad said. “Both sets of players have shown considerable skill. The pitch hasn’t been great for the batsmen.
“I think Bangladesh will be very proud with their performance. We are proud we have utilised our skills in these conditions.
“This was our first Test match here for six years. There’s going to be 11 very disappointed and 11 delighted guys tomorrow. This is not going to be a draw,” Broad said.
Bangladesh coach Chandika Hathurusinghe was happy to see his charges taking the fight to the visitors.
“I am really happy that they took 20 wickets,” he said.
“I am happy to be still in the game in the fourth day against a team like England. I don’t think anyone gave us a chance four days ago.”
Stumps were drawn early due to bad light after England were told they could only use their spinners and not the pace attack in the last five overs, a condition they did not accept.
England's spinners earlier dismissed Bangladesh's top five to leave them on 140-5, as Moeen Ali and Adil Rashid chipped in with useful wickets.
Ali removed a positive-looking Shakib Al Hasan for 24 just as the all-rounder was trying to rebuild the innings after Batty trapped Mominul Haque (27) and Mahmudullah (17) in the post-lunch session.
Rashid claimed Imrul Kayes for 43 in the penultimate over before lunch. Kayes, who hit six fours in his 61-ball innings, looked well settled until he misjudged a sweep to get a top edge to Joe Root at slip.
Moeen handed England their first breakthrough when he removed Tamim Iqbal for nine as Ballance took the catch at forward short leg.
Just one ball earlier, Tamim had survived a review after Root took a catch that initially hit the body of a tumbling Ben Stokes at slip. The replay indicated there was no bat or glove involved.
England were all out for 240 in their second innings in the fifth over of the morning, after adding just 12 to their overnight tally of 228-8.
Left-arm spinner Taijul Islam trapped Batty leg before off his second ball after Stuart Broad was run out on his overnight score of 10. Chris Woakes was unbeaten on 19.
The second and final Test will start in Dhaka on 28 October.