Sohag Gazi struck a maiden century as the Bangladesh lower order fought back on the fourth day of the first Test against New Zealand to leave the match in Chittagong heading for a draw.
The home side had resumed on 380 for seven in reply to New Zealand's first innings of 469 all out but Gazi led a spirited fightback, including a ninth-wicket stand of 105 with Robiul Islam.
Gazi struck 10 fours and three sixes in his unbeaten innings of 101 before running out of partners as the hosts were dismissed for 501 after lunch.
Bangladesh lost Abdur Razzak in the fifth over of the day when he was trapped leg before wicket by Trent Boult for seven.
Robiul had made a patient 33 when seamer Doug Bracewell had him dismissed after a top edge which
Williamson leads New Zealand charge with century
Mominul's maiden ton takes Bangladesh close to Kiwi total
Sodhi, Anderson in New Zealand Test squad for Bangladesh
WC Qualifiers: Lavezzi scores two as Argentina make light of Messi absence
Challenging conditions to test top team status