Bangladesh 178 and 254 for 5 (Ashraful 70, Tamim 47, Junaid 37, Shakib 34*, Murali 3-85) need another 267 runs to beat Sri Lanka 293 and 405 for 6 dec (Jayawardene 166, Samaraweera 62, Sangakkara 67, Dilshan 47)
Scorecard and ball-by-ball details
How they were out
A sixth-wicket partnership of 74 between a restrained Mohammad Ashraful and Shakib Al Hasan ensured Bangladesh won the final session and took an improbable chase of 521 into the fifth day in Mirpur. Sri Lanka are still favourites to win the Test, though - Bangladesh need another 267 with only five wickets in hand.
The biggest gain for Bangladesh was the composed half-century by captain Ashraful, who shed his usual reckless style for a more sedate approach after the rash dismissals of Tamim Iqbal and Mehrab Hossain jnr.
There was a distinct change in Ashraful's body language at the crease. He was far more relaxed in his movements, studied the field thoroughly before facing up to the spinners, cut out the lofted strokes and played each ball on merit. His driving through the off side was impeccable - especially against Muttiah Muralitharan, who persisted by bowling full outside the off stump.
Sri Lanka were clearly trying to lure Ashraful into playing an uppish drive through cover, which led to his dismissal in the first innings. Perhaps conscious of that, Ashraful drove firmly along the turf and peppered the cover and extra-cover region with nine boundaries off the spinners, mostly Muralitharan. One such shot, through extra cover, brought up his half-century - his first in 19 innings - and his muted celebrations indicated he knew his job was far from over. His only false shot was a wild slash off a wide Chaminda Vaas delivery - he showed his dismay at the lapse in concentration, walking away from the middle and shaking his head - and his application was reminiscent of his unbeaten 129 against the same opposition at the P Saravanamuttu Stadium last year.
His partner, Shakib, one of Bangladesh's more reliable players down the order, also cut down on the risky shots, save for a scoop off Rangana Herath that just cleared mid-off. He tried to get on top of the bowlers in the first innings but this time focused on playing for the team - and more so for his captain, who delighted the fans with his sparkling front-foot drives.
As Bangladesh steadily progressed from 200 to 250 off 95 balls, Mahela Jayawardene brought on his quicker bowlers, Vaas and Dammika Prasad, but they weren't effective enough with the old ball.
Ashraful and Shakib gave the home fans the fightback they'd been craving after Bangladesh tamely conceded the first two sessions. Sri Lanka's declaration in the morning session was on the cards after Jayawardene worked his way to his ninth 150-plus score in Tests. Tillakaratne Dilshan helped himself to 47, dominating the spinners, before Jayawardene declared.
Bangladesh's target was formidable - 521 runs and, more importantly, the better part of two days to bat out - and the top order made starts but failed to build on them as the Sri Lankans kept nibbling away. Imrul Kayes got the chase off the blocks with some scorching drives straight down the ground and the off side before falling victim to a direct hit by Dilshan at the stroke of lunch.
Dammika Prasad ran in hard and peppered the left-handers, Junaid Siddique and Tamim Iqbal, with short balls that kept them from playing too aggressively. Tamim played one of the best shots of the day, whipping a half-volley on the pads off Prasad and placed it precisely in the gap between two fielders on the on side. However, a lapse in concentration saw him gloving a Prasad bouncer down the leg side while trying to hook. Another promising innings came to an end, and Tamim trudged back on 47 with a look of dejection.
Raqibul Hasan showed the patience to defend and hold one end up. He eased into his rhythm with a front-foot punch past Prasad and picked Herath for boundaries, again off the front foot, through midwicket. He had made a sound start before being squared up by a Muralitharan doosra that clipped the off stump. Mehrab supported his captain for a while before succumbing to a rush of blood, scooping a catch to mid-off against Muralitharan.
That was to be Sri Lanka's last success for the day as Shakib and Ashraful held firm. Theirs may not be a match-winning stand but it did restore some respectability and gave the team a shot at going past Bangladesh's highest fourth-innings total, 285 for 5 against Zimbabwe in 2005.
Kanishkaa Balachandran is a sub-editor at Cricinfo