Liton Das scored his maiden Test century as he, along with Mushfiqur Rahim, helped rebuild the innings after a top-order collapse in the first Test against Pakistan in Chittagong on Friday.
At stumps on day one, Bangladesh were on 253 for 4 in their first innings.
Opting to bat first, the hosts were in trouble at 49-4 before the duo turned the tide with a 204-run unbroken fifth-wicket stand.
Liton led the charge, smashing 11 fours and hoisting off-spinner Sajid Khan over long-on for his only six in the innings.
He struck left-arm spinner Nauman Ali to bring up his 10th Test fifty before Mushfiqur followed suit, his 24th in Tests, with a four off Hasan Ali.
Liton, who was dropped on 67 by Sajid at short midwicket off Afridi, completed his maiden Test hundred with a tricky single off left-arm spinner Nauman Ali.
He had to dive to complete the run after pushing Ali at mid-off and a direct hit could have cost him his wicket on 99.
Mushfiqur hugged Liton as he stood back to kiss his helmet and raise his bat responding to applaud from the gallery and the dressing room.
UK to place six African nations on travel 'red list' over new COVID-19 variant
Mushfiqur also batted solidly, hitting 10 fours.
Pakistan's bowlers had dominated the opening session as Shaheen Afridi, Hasan Ali, Faheem Ashraf and Sajid each claimed a wicket.