Sri Lanka made late inroads in Bangladesh's order after being largely frustrated by Tamim Iqbal and Soumya Sarkar's century stand on day two of the first Test in Galle.
Kusal Mendis fell agonisingly short of a double century as he built on an overnight score of 166 to reach a Test-best 194, while Niroshan Dickwella contributed 75 to Sri Lanka's total of 494.
On a batting-friendly pitch, Sri Lanka initially struggled to make inroads with the ball as Tamim (57) and Sarkar (66 not out) put on 118, Bangladesh's highest opening stand against Sri Lanka.
But, after dangerman Lakshan Sandakan's relentless pressure failed to yield a wicket, Tamim was bizarrely run out by Dickweller before Mominul Haque (7) quickly fell to Dilruwan Perera to leave Bangladesh on 133-2 - still 361 runs in arrears.
Mendis and Dickwella took their stand beyond a century in the morning session, although the former was lucky Mustafizur Rahman overstepped the fine leg boundary when taking a catch off Subashis Roy's bowling.
However, Mendis' luck ran out with another attempted slog that Tamim threw up in the air, momentarily stepped over the ropes, and returned to pouch the catch.
Dickwella was typically lively and crunched the second ball he faced over leg side for six before bringing up his half century off just 52 balls.
His hopes of a maiden Test hundred ended with a top edge to Mahmudullah at short third man, and Perera hit a 77-ball 51 before becoming Mehedi Hasan Miraz's fourth victim.
Bangladesh's reply almost started in poor fashion when Sarkar's drive off Suranga Lakmal flew towards gully, but Perera reacted too slowly and put the chance down.
Sarkar - who later survived an lbw review - made the most of the let off by solidly constructing his second Test half-century, which included a fine straight six back over Perera.
Tamim had nervy moments as well, being dropped by Dickwella and just grounding his bat in time to avoid a direct hit run out, but he played with patience and poise en route to a 21st Test 50.
But he fell in unusual circumstances. Tamim aimlessly ran down the track not realising Dickweller had the ball in his gloves following a shout for caught behind, allowing the wicketkeeper to take off his stumps.
Haque was then trapped plumb lbw and, though Bangladesh may feel they still edged the final session, the tourists have something to ponder when Sarkar and Mushfiqur Rahim (1) resume on day three.