Mushfiqur Rahim's 126 runs salvaged early wobbles from Bangladesh to put them in control of their one-off test against Ireland on Wednesday, the hosts reaching 369 all out in the final session of day two.
Bangladesh led by 155 runs at the change, with offspinner Andy McBrine's 6-118 putting the brakes on a further blowout in Dhaka.
Mushfiqur's 10th test century was ably assisted by skipper Shakib Hasan's 87, while Mehidy Hasan was the last man dismissed on 55.
Bangladesh had resumed on 34-2 and lost Mominul Haque, bowled round his legs for 17, in the third over of the morning after adding just six more runs with Mushfiqur.
But Shakib and Mushfiqur turned up the aggression to quickly claw back the deficit with a 159-run partnership for the fourth wicket.
Shakib was at his mercurial best until he chased a ball from McBrine wide outside the off stump to get a feather touch on the bat.
He was caught behind after an impressive 14 fours from his 94-ball knock.
Liton Das joined Mushfiqur to continue on the front foot, adding 87 runs for the fifth wicket.
Mushfiqur finished his hundred off 135 balls with a four off Adair before Ben White dismissed Liton for 43 runs.
McBrine finally dispatched Musfiqur – with Murray Commins taking a fine diving catch at long-on – and cut short the tail with three wickets in three consecutive overs.
It was McBrine's maiden test five-wicket haul and only the second from the Irish team.
Ireland have lost all three of their previous tests since becoming a full member of the International Cricket Council in 2017.