Left-arm spinner Taijul Islam claimed 4-40 to put Bangladesh within three wickets of a famous win over New Zealand in the first Test in Sylhet on Friday.
Set a target of 332 runs, New Zealand stuttered to reach 113-7 at stumps on the fourth day, still needing 219 runs for what looked like an improbable win.
Daryl Mitchell dragged the match into the fifth day with an unbeaten 44, remaining New Zealand's only hope to produce a miracle.
Ish Sodhi was with him on seven, but not before he was reprieved by the third umpire after initially being given out two overs before stumps.
Bangladesh will be looking to wrap up the New Zealand innings quickly on the fifth and final day for what they hope will be their second Test win against New Zealand and their first at home.
"It's fun to beat a big team, " Taijul said. "We haven't won yet but, inshallah (God willing), we are trying our best."
- 'Still fight' -
New Zealand's Ajaz Patel said the Kiwis had "obviously a lot of batting to do" but insisted the battle was not over.
"We'll come out there and still fight and see where we get to," he said.
"We've got Dazzler (Mitchell) there who's batted quite nicely today."
Pacer Shoriful Islam and spinners Mehidy Hasan Miraz and Nayeem Hasan complemented Taijul with a wicket each to put them firmly on course.
The Kiwis lost opener Tom Latham to Shoriful for a duck before the scoreboard was moved and never appeared to recover from the early blow.
Taijul swiftly removed danger man Kane Williamson leg-before for 11 and Mehidy got rid of Henry Nicholls for two to leave New Zealand struggling at 37-3 at tea.
Devon Conway fell to Taijul for 22, giving a catch to close-in fielder Shahadat Hossain soon after the resumption.
Taijul then knocked over Tom Blundell for six to put New Zealand in further trouble.
Mitchell and Glenn Phillips added 21 runs for the sixth wicket to momentarily halt Bangladesh's victory push.
Nayeem hit Phillips in front of the wicket on 12 before Taijul removed Kyle Jamieson for nine.
Mushfiqur Rahim and Mehidy earlier added a half-century each after skipper Najmul Hossain Shanto's ton.
Mushfiqur hit 67 before Mehidy took on the mantle and carried Bangladesh to 338 in their second innings, with the hosts adding 126 runs to their overnight score of 212-3.
Patel took the last wicket, that of Shoriful, to finish with 4-148 for New Zealand, while leg-spinner Sodhi claimed 2-74.
Tim Southee dismissed Najmul in the second over of the day after the Bangladesh skipper added just one run to his overnight 104.
Fellow overnight batsman Mushfiqur was trapped leg-before by Patel after he completed his 27th Test fifty.
New Zealand cleaned up the last three wickets in less than an hour after the lunch break.
str-pjm/pbt