Samaraweera and Dilshan batter Bangladesh
Dilshan, who had a serious injury concern the previous evening after getting hit on the elbow at practice, scored an exhilarating 168 from 179 balls, an innings that included 19 boundaries and a six. It was his highest Test score and his fourth Test hundred. Samaraweera, meanwhile, finished with 138 from 217 balls, his fifth Test hundred
Bangladesh did dismiss both before the close - Dilshan edging a tired square cut and Samaraweera chipping the second new ball straight to midwicket - but to rub salt into Bangladesh's wounds Chaminda Vaas strolled out to bat without a helmet and cracked a quick 61 not out while Muttiah Muralitharan struck some lusty blows during an unbroken 49-run eighth wicket stand.
There may be some dressing room discussion about an overnight declaration to make use of any early morning moisture but the chances of persuading Muralitharan to give up his quest for a second Test fifty appear slim. In any case, most of the moisture that created problems for Sri Lanka's top order in the morning will have already been burnt off by a strong sun and a stiff breeze.
The first session had belonged emphatically to Bangladesh as their new-ball bowlers, Syed Rasel and Shahadat Hossain, spoilt Sanath Jayasuriya's 100th-Test party and precipitated an early slump with some intelligent and skillful swing bowling.
Sri Lanka were always likely to bat first if they won the toss, but they would also have realised that the pitch at the P Saravanamuttu Stadium can be lively during the first hour. They needed to weather the new ball and they started well enough, with Jayasuriya twice pulling handsomely over square leg as 28 runs were added in the first five overs.
But after a nervy start that included one rank full-toss, Hossain discovered some rhythm and movement. First, an inswinger came within a whisker of uprooting Marvan Atapattu's off stump as he shouldered arms; then, he produced a peach of an outswinger that kissed the outside edge.
But it got worse for the hosts. Mahela Jayawardene has been in rich form in recent times but he was soundly beaten by an inswinger from Hossain that nipped back between his bat and pad to knock back the off stump. Kumar Sangakkara, meanwhile, looked out of sorts. He could have been run out on two occasions before his 22-ball stay was ended by a fine piece of bowling: Rasel followed a series of gentle outswingers with a vicious inswinger that rushed back through the gate.
Unfortunately for Bangladesh, they didn't have the fast-bowling resources to back up their two new-ball bowlers, as they opted to play two specialist spinners in the team. Thus, when Habibul Bashar was forced to turn to the wobblers of Aftab Ahmed, the pressure started to ease. Samaraweera and Dilshan were able to steady the innings and Sri Lanka went to lunch on 107 for 4.
However, after the break, the game accelerated as Dilshan launched a stunning counterattack. He was merciless on full-pitched deliveries from the seamers, thrashing them through the covers with a full swing of the bat. The spinners, especially Mohamad Rafique, were dealt with particularly harshly as Dilshan swept square, cut late and danced down the pitch whenever allowed.
Samaraweera had been the aggressor before the break, playing his part as Sri Lanka launched their recovery, but during the afternoon he was content to sit back and play second fiddle while Dilshan ripped the Bangladeshi bowling to shreds. The session yielded 161 runs in 32 overs and Dilshan scored 103 of those.
Marvan Atapattu c Mashud b Hossain 11 (28 for 1)
Nicked a full-length outswinger
Sanath Jayasuriya lbw b Rasel 13 (28 for 2)
Caught in front by an inswinger
Mahela Jayawardene b Hossain 2 (33 for 3)
Pushed forward tentatively and was bowled by inswinger
Kumar Sangakkara b Rasel 5 (48 for 4)
Set up by a series of outswingers and then beaten by an indipper
Tillakaratne Dilshan c Mashud b Ahmed 168 (328 for 5)
Tired edge to the wicket-keeper
Thilan Samaraweera c Nafees b Rasel 138 (397 for 6)
Clipped second new ball to midwicket
Rangana Herath lbw Hossain 1 (400 for 7)
Played all around a good ball that straightened
Charlie Austin is Cricinfo's Sri Lankan correspondent