Kane Williamson hit a fluent century for New Zealand before Bangladesh hit back in the final session of the opening day's play in the first Test in Chittagong on Wednesday.
Williamson made 114 to enable the Black Caps reach to 280-5 after they won the toss and elected to bat on a newly-laid pitch at the Zahur Ahmed Chowdhury stadium.
New Zealand were coasting at 244-2 when left-arm spinner Abdur Razzak, recalled to the Test side after two years, grabbed two of the three wickets that fell after tea.
Williamson was leg-before to Shakib Al Hasan in the penultimate over, before Razzak dismissed skipper Brendon McCullum (21) off what turned out to be the final delivery of the day.
The flurry of late wickets undid the good work of the top order where opener Peter Fulton made a patient 73 to lay the foundation of a big total.
Fulton put on 57 for the first wicket with Hamish Rutherford (34) and 126 for the second with Williamson on a slow wicket that offered no help to the bowlers.
Fulton, who needed 156 balls to reach his 50, celebrated his third half-century in Test cricket by pulling Marshall Ayub for a six over mid-wicket.
But the 34-year-old from Canterbury fell just before tea, hitting a short ball from part-time spinner Nasir Hossain to Mominul Haque in the covers.
Williamson moved to 98 with a back-foot punch off spinner Sohag Gazi for a boundary and then completed his fourth Test century with another four off Razzak in the next over.
Former captain Ross Taylor scored 28 in a third-wicket stand of 61 with Williamson before edging an intended flick off Razzak to substitute Naeem Islam in the covers.
Bangladesh captain Mushfiqur Rahim claimed the second new ball as soon as it was due after 80 overs and managed to scalp both Williamson and McCullum just before the close.
New Zealand awarded Test caps to leg-spinner Ish Sodhi and all-rounder Corey Anderson, while batsman Marshall Ayub made his debut for the hosts.
The second Test will be played in Dhaka from October 21 to 25, followed by three one-day internationals and a Twenty20 game.