Angelo Mathews and Dinesh Chandimal have made centuries before Sri Lanka further raised hope of winning the second Test by reducing Bangladesh to 4-34 by stumps on day four.
The hosts still need 107 runs on the last day to force Sri Lanka to bat a second time. Bangladesh were in survival mode after their hope of a first home series win over Sri Lanka was shattered.
Mushfiqur Rahim and Liton Das, who helped Bangladesh recover from 5-24 to post 365 on Tuesday with a record 272-run partnership, were in the middle at stumps after another top-order rout. Mushfiqur was 14 not out and Liton on 1.
Mathews followed his 199 in the first innings with an unbeaten 145, and Chandimal scored 124 to give Sri Lanka a 141-run lead. They were all out after tea for 506 in the first innings.
Mathews and Chandimal combined for 199 runs for the sixth wicket to take the game away from Bangladesh, despite left-arm spinner Shakib Al Hasan's 5-96.
Sri Lanka captain Dimuth Karunaratne hit 80, his opening partner Oshada Fernando struck 57, and Dhananjaya de Silva added 58 for their team's cause.
The day's play started 30 minutes early to make up for time lost on Wednesday, and Mathews and Chandimal, resuming on 58 and 10 respectively and their team on 5-282, rode their luck.
Mathews, dropped on 37, scored briskly to reach his 13th century off 274 balls, pushing a Mosaddek Hossain delivery to midwicket for a single. Soon after, he overturned an lbw decision.
Chandimal, who raised his 12th century off 181 balls, got successful video reviews on 43 and 75.
But after two wicket-less sessions, Bangladesh hit back with five wickets for 41 runs. Chandimal's dismissal started the collapse.
Medium-pacer Ebadot Hossain bagged Chandimal after playing 219 balls and hitting 11 boundaries and a six
Shakib joined the party and completed his 19th five-for when Praveen Jayawickrama poked a tossed-up delivery to wicketkeeper Liton Das for a duck.
Ebadot took 4-148 and Asitha Fernando was run out to leave Mathews stuck on 145. Mathews faced 342 balls and hit 12 fours and two sixes.
A disciplined Sri Lanka attack then put the visitors in complete command with pacer Fernando leading the way with 2-12.
He dismissed opener Tamim Iqbal for an 11 ball-duck to give the batter a pair for the first time in his career.
Fernando also had opener Mahmudul Hasan caught by Kusal Mendis for 15 after the batter survived two strokes of luck.
Najmul Hossain was run out on 2 and captain Mominul Haque's lean streak was extended to a seventh straight single-digit figure when Kasun Rajitha dismissed him for a duck.
Australian Associated Press
Sign up for our newsletter to stay up to date.