Bangladesh lost four wickets in the final session to slump to 214 for five on day two of their second and final Test against Sri Lanka on Thursday.
Shakib Al Hasan, on 18, and skipper Mushfiqur Rahim (two) were together at stumps with the tourists still 124 runs behind the hosts.
Earlier, Dinesh Chandimal completed his eighth Test century to help Sri Lanka post 338 all out in their first innings at the P Sara Oval.
Chandimal made 138 as the last three Sri Lankan wickets put on 143 runs, adding 100 to their overnight score of 238 for seven to consolidate their position.
Bangladesh mounted a strong reply with Soumya Sarkar (61) hitting his third fifty in as many innings as he and fellow opener, Tamim Iqbal, who made 49, put on 95 for the first wicket.
Imrul Kayes made 34 and Sabbir Rehman chipped in with 42 but Sri Lankan left-arm chinaman bowler Lakshan Sandakan claimed three wickets to halt Bangladesh's progress.
SCOREBOARD (Day 2)
Sri Lanka 1st innings (overnight 238 for 7)
D Karunaratne c Mehedi b Mustafizur 7
U Tharanga c Soumya b Mehedi 11
K Mendis st Mushfiqur b Mehedi 5
D Chandimal c Mosaddek b Mehedi 138
A Gunaratne lbw b Roy 13
D de Silva b Taijul 34
N Dickwella b Shakib 34
D Perera c Soumya b Mustafizur 9
R Herath c Soumya b Shakib 25
S Lakmal c Soumya b Roy 35
L Sandakan not out 5
Extras: (B-1, LB-13, W-6, NB-2) 22
Total: (all out, 113.3 overs) 338
Fall of wickets: 1-13, 2-24, 3-35, 4-70, 5-136, 6-180, 7-195, 8-250, 9-305.
Bowling: Mustafizur 21-6-50-2, Roy 17.3-2-53-2, Mehedi 21-2-90-3, Taijul 17-2-40-1, Shakib 33-4-80-2, Mosaddek 4-0-11-0.
Bangladesh 1st innings
Tamim Iqbal lbw b Herath 49
Soumya Sarkar b Sandakan 61
Imrul Kayes lbw b Sandakan 34
Sabbir Rahman c de Silva b Lakmal 42
Taijul Islam lbw b Sandakan 0
Shakib Al Hasan not out 18
Mushfiqur Rahim not out 2
Extras: (B-4, LB-4) 8
Total: (five wickets in 60 overs) 214
Fall of wickets: 1-95, 2-130, 3-192, 4-192, 5-198.
Bowling: Lakmal 11-2-32-1, Perera 19-5-50-0, Herath 12-1-34-1, Gunaratne 4-0-25-0, Sandakan 14-1-65-3.