Upul Tharanga scored his first Test century on home soil for Sri Lanka as they solidified their command of the first Test with Bangladesh, though 10 wickets are still required for victory on day five.
Bangladesh were bowled out for 312 in response to Sri Lanka's first-innings total of 494 on day three. And Tharanga pressed home Sri Lanka's advantage in Galle with a brisk 115, Dinesh Chandimal (50 not out) providing support before the hosts declared on 274-6.
The tourists reached the close, which was called early due to bad light, unscathed on 67-0 but still 390 runs adrift of the victory target.
Dimuth Karunaratne went for 32 after putting on 69 for the opening wicket with Tharanga, who pushed the pace with an impressive 171-ball stay at the crease.
Tharanga hit 11 fours and two maximums as he finally reached three figures in Sri Lanka, nearly 11 years after making his first home Test appearance.
His efforts made up for a disappointing second knock from Kusal Mendis, who fell just six runs short of a double-century in the first innings but went for 19 this time around.
Mehedi Hasan Miraz finally removed Tharanga by dislodging his off-stump but, even though Asela Gunaratne went for a duck in the next over, the damage had already been done with the hosts on 199-4.
Chandimal and Dilruwan Perera (33) pushed Sri Lanka past 250, the latter's dismissal prompting captain Rangana Herath to call for the declaration with his side 456 runs ahead.
Bangladesh set about their challenge of surviving the day without loss with enthusiasm, Soumya Sarkar the primary aggressor.
Sarkar, who scored 71 in his first innings, continued an excellent performance with his second half-century of the contest, reaching 53 off 47 balls before the fading visibility forced the umpires to call proceedings to a halt.