Upul Tharanga starred with a career-best 160 not out, his maiden Test century and highest first-class score, to revive a Sri Lanka innings that was in a parlous state in the morning. Batting throughout the day, Tharanga battled hard, as Sri Lanka closed on 302 for 8, a lead of 68 runs.

Tharanga's fine knock, a mixture of studious defence and adventure, saved Sri Lanka from potential embarrassment as they slumped to 43 for 4. First, he consolidated the innings in partnership with Mahela Jayawardene (49), settling dressing-room nerves as they added 124 runs, before carrying Sri Lanka to first-innings parity with Tillakaratne Dilshan (33).

But once again, when a run fest had beckoned after Muttiah Muralitharan's first-day wizardry, Bangladesh displayed resilience and a never-say-die spirit. Perhaps, with hindsight, they might rue not being more aggressive in the first session, but they could not be faulted for application or effort.

Shahadat Hossain epitomised this spirit with intense bursts throughout the day. In the first Test he mopped up the Sri Lanka tail with a series of bumpers and here he shook up the top order as Thilan Samaraweera (20) feathered a catch behind off a rising ball and Kumar Sangakkara (0) departed first ball to an lbw shocker.

Later on, too, as Sri Lanka eyed a commanding lead after the tea interval, Bangladesh came back strongly, this time through their spinners as Mohammad Rafique hurried an arm through Dilshan and Enamul Haque snapped up both Farveez Maharoof (7) and Dilhara Fernando to leave Sri Lanka on 263 for 8.

Sri Lanka, though, finished strongly with an obstinate stand between Tharanga and Lasith Malinga, who batted responsibly in his newly-promoted position of No.9, hanging in for 64 balls for his 12 not out. The pair added 39 in the final hour, tipping the match towards Sri Lanka as their lead reached handy proportions.

However, Bangladesh are by no means out of the fight yet. Should they clean up the tail on the third morning then they are still in the game. The question is whether they can deliver in the second innings as the pressure intensifies - if they can then Sri Lanka will be left with a tricky run chase.