Bangladesh earned a 129-run first innings lead in the second Test against Sri Lanka after a century from Shakib Al Hasan.
The all-rounder's knock of 116, in addition to fifties from Mushfiqur Rahim and Mosaddek Hossain, helped the visitors to 467 in Colombo, comfortably surpassing Sri Lanka's 338.
Sri Lanka responded well with the openers taking them to 54-0 at stumps but they will start day four with a 75-run deficit still to overcome.
After a flurry of late wickets on day two, Bangladesh resumed on 214-5 with Shakib and Rahim at the crease, and the pair added another 76 to the total in the morning session before Rahim was bowled by Suranga Lakmal having just gone to his half-century.
Any hopes Sri Lanka had of bringing the innings to a swift end soon vanished as Mosaddek, on debut, joined Shakib. A 131-run partnership followed with Shakib going to his fifth Test hundred before falling to Lakshan Sandakan (4-140) as tea approached.
Mosaddek (75) was the last man out, his stay at the crease ended by Rangana Herath, who mopped up the tail to finish with figures of 4-82.
That gave Bangladesh 13 overs to try and make inroads into the Sri Lanka top order but Upul Tharanga (25no) and Dimuth Karunaratne (25no) stood firm to see the hosts safely through to stumps.