BJ Watling and Trent Boult recorded the second-highest 10th-wicket partnership for New Zealand before Bangladesh hit back on the second day of the first Test.
The pair came together with the Black Caps wobbling after a morning collapse but batted brilliantly - Watling the star with his second Test century - to guide their side to a first-innings total of 469.
Boult then struck with the second ball of the reply, only for the home side to stabilise and reach 103 for two at stumps to trail by 366 runs in Chittagong.
After resuming on 280 for five, the Black Caps lost Bruce Martin and Corey Anderson in quick succession as Rubel Hossain and Abdur Razzak struck.
Doug Bracewell chipped in with a responsible 29 to offer Watling able support yet it was the arrival of Boult that heralded a real upturn in fortunes for the tourists.
Watling eventually perished having made 103 with his and Boult’s partnership of 127 the second best by a New Zealand duo for the last wicket, falling 24 short of the record set by Richard Collinge and Brian Hastings against Pakistan over 30 years ago.
Bangladesh appeared understandably downbeat when they got their innings under way and Boult, having started with a wide, tempted Tamim Iqbal to drive at a wide ball and be caught at gully.
It was soon eight for two when Anamul Haque, having already survived an edge off a no-ball, was trapped leg before wicket by Bracewell.
The tourists were firmly in the ascendancy but then came the Bangladesh fightback, led by Mominul Haque, who responded with a fine 77 not out.