Opener Soumya Sarkar scored his second half-century of the match as Bangladesh kept their faint hopes of saving the first Test against Sri Lanka alive in Galle on Friday.
Set a daunting target of 457 runs, Bangladesh reached 67-0 before bad light brought early stumps on the fourth day with the visiting side still needing 393 runs for an improbable win on the final day.
Soumya, who made 71 runs in the first innings, led the batting charge with an unbeaten 53 while his opening partner Tamim Iqbal took the unusual role of an anchor, scoring 13 not out.
The fourth day's play ended 14 overs early as thick clouds hovered over the ground, much to the frustration of the hosts who were desperate to hammer home their advantage by clinching a wicket in the final session.
Umpires called off play after Asela Gunaratne conceded three runs off his first ball that was declared a rare back-foot no ball, leaving him with the highly unusual figure of 0-0-3-0.
Sri Lanka declared their second innings at 274-6, just five overs into the session, after local boy Upul Tharanga slammed his third Test century and second against Bangladesh.
Tharanga was out for 115 at the end of a 171-ball innings that featured 11 fours and three sixes before he was bowled by off-spinner Mehedi Hasan.
Left-arm spinner Shakib Al Hasan bowled Asela Gunaratne for a duck in the next over and Mehedi dismissed Niroshan Dickwella for 15 to give Bangladesh something to celebrate in another taxing day for the visitors.
Dinesh Chandimal rode his luck after being dropped by Soumya Sarkar at slip on 12 to stay unbeaten on 50 before the declaration came with the dismissal of Dilruwan Perera, who made 33.
Earlier in the second session, Shakib removed Sri Lanka's first innings hero Kusal Mendis who made 19 before hoisting a catch to Taskin Ahmed at square leg boundary. Mendis scored 194 in the first innings.
Sri Lanka began their second innings in the morning cautiously as they scored 87 runs for the loss of opener Dimuth Karunaratne, who gave a catch to Mahmudullah at square leg off Taskin Ahmed after making 32.
But the hosts accelerated in the second session and notched up 160 runs in 31 overs.
Tharanga, who scored just four runs in the first innings, led the way and brought up his century with a single off Shakib.
He was satisfied with his effort.
“I am pleased. (In the) first innings I couldn’t do much and I wanted do the job for the team today,” he said after the day’s play.
“Our plan was to give them 125 overs. If you take the wicket, more than the other Galle wickets, this doesn't have much turn,” he added.
Shakib and Mehedi each claimed two wickets for Bangladesh, conceding 104 and 77 runs respectively.
Shakib was cautious about team’s plan on the fifth day.
“If we play well in the first session (tomorrow), we can take it from there on,” he said. “If we try too many things at the start of the session, we might lose a few wickets and end up losing the game.”
Bangladesh were all out for 312 runs in their first innings, replying to Sri Lanka's total of 494.