Mushfiqur Rahim has hit a century while becoming the first Bangladesh batter to reach 5000 Test runs, before his side rammed home their advantage in Sri Lanka's second innings on the penultimate day of the series opener.
Mushfiqur's eighth century, and first since 2000, helped Bangladesh take a 68-run lead after the home side were bowled out for 465 - and they then reduced Sri Lanka to 2-39 in their second knock on Wednesday.
Mushfiqur was finally out for 105 when trying to sweep left-arm spinner Lasith Embuldeniya.
Sri Lanka, who were dismissed for 397 in their first innings, still need 29 runs to erase the deficit.
Tamim Iqbal top-scored for Bangladesh with 133, while Liton Das made 88 and opener Mahmudul Hasan 58.
After the day's play was delayed by 30 minutes because of rain, Bangladesh, who resumed on 3-318, moved slowly in the morning session.
Mushfiqur was 15 runs short of the 5000-run milestone when play resumed and he hit the mark, in his 81st Test match, with two runs to fine leg off pace bowler Asitha Fernando.
Vishwa Fernando's concussion sub, Kasun Rajitha, struck twice in the first two balls of the post-lunch session.
He first removed Das, bringing an end to the 165-run partnership with Mushfiqur.
Iqbal, who retired hurt on 133 on the third day, came to the crease again but played an expensive drive to be out in the first ball he faced, missing the 5,000-run landmark by 19 runs.
Mushfiqur helped Bangladesh then earn the lead and completed his century off 270 balls, glancing Asitha Fernando for a boundary through fine-leg.
It was, however, the slowest century for him in terms of balls faced.
While Mushfiqur moved slowly, Shakib Al Hasan tried to pace the innings but he top-edged a delivery from Asitha to the wicketkeeper to fall for 25.
Mushfiqur followed him soon after as Bangladesh's lead grew to 42.
The Bangladeshi tail-enders, however, couldn't make any resistance with No.10 batter Shoriful Islam retiring hurt.
Rajitha registered a career-best 4-60 and Asitha had figures of 3-72.
When the tourists batted again, Oshada Fernando was run out for 19 while nightwatchman Embuldeniya was bowled by Taijul Islam for two.
Australian Associated Press
Sign up for our newsletter to stay up to date.