Replying to New Zealand's mammoth 553 for seven declared, Bangladesh replied in strong fashion, scoring 408 and also claimed the wicket of New Zealand opener B J Watling in the first Test being played at the Seddon Park in Hamilton.
Watling was run out for one in a disappoitning start to their second innings. Bad light forced the players off soon after with New Zealand 9-1.
That gave them a commanding lead of 154 from which they should win this Test.
But Wednesday was Bangladesh's day after Mohammad Mahmudullah scored a century to stall the home side with some stubborn batting.
Bangladesh fought hard to successfully avoid the follow-on as they chased New Zealand's 553-7.
Mahmudullah and Shakib Al Hasan added 145 for the seventh wicket. The pair batted throughout the middle session as they applied themselves to frustrate New Zealand with a stubborn stand that also had its share of fluent strokes.
It provided a Bangladesh record partnership for any wicket against New Zealand but was ended just after the break when Chris Martin had Shakib Al Hasan caught behind for 87.
Mahmudullah carried on the fight moving through to record his maiden century and finish with 116 before he was trapped lbw by Daniel Vettori.
Earlier five wickets fell in a productive opening session for the Black Caps with pace bowlers Martin, Tim Southee, Martin and Daryl Tuffey playing their parts and spinner Vettori chiming in as well.