Sri Lanka declared their first innings at 520-8 during the tea interval of the third day's play in the first cricket Test against India on Tuesday.
A superb rearguard action by Sri Lanka's tailenders helped the hosts pile up runs on the third day of the rain-hit first Test.
India’s seamers had grabbed four important wickets, three of them by the lanky Ishant Sharma, as Sri Lanka slipped from Sunday's total of 256-2 to 344-6 before lunch.
But Rangana Herath and Lasith Malinga proved unlikely saviours with career-best scores during a rousing stand of 115 for the eighth wicket.
Herath, who had put on 49 for the seventh wicket with Prasanna Jayawardene, was unbeaten on 80 with 10 fours and a six.
Malinga smashed nine boundaries and two sixes in a breezy 64 off 75 balls before his dismissal, which signalled the entry of retiring spin legend Muttiah Muralitharan.
The world's most successful bowler with 792 Test and 515 one-day wickets was welcomed to the crease by fireworks as the Indian fielders lined up to applaud him with a guard of honour.
Muralitharan was unbeaten on five with skipper Kumar Sangakkara declaring the innings during the break.
The second day's play had been washed out on Monday without a ball being bowled, while 22 overs were lost on the first due to heavy rain in this southern coastal town.
When play started an hour late on Tuesday, India's young seam attack of Sharma and debutant Abhimanyu Mithun rattled the Sri Lankans with appreciable movement both in the air and off the wicket.
Opener Tharanga Paranavitana, who hit a maiden Test century on the first day, managed to add just one run to his score of 110 when he was caught behind off Sharma in the day's second over.
Mithun struck 10 balls later by trapping new batsman Thilan Samaraweera leg-before for zero, two deliveries after the batsman was dropped at first slip by Rahul Dravid.
Mahela Jayawardene put on 62 for the fifth wicket with Angelo Mathews, before he was claimed leg-before by Sharma with a ball that dipped in sharply.
The former captain made an attractive 48 with six boundaries.
Mathews fell for 41 just before the lunch break when Venkatsai Laxman dived to his right at second slip to pick up a low catch off Sharma.
Sri Lanka first innings (overnight 256-2)
T Paranavitana c Dhoni b Sharma 111
T Dilshan c Dhoni b Mithun 25
K Sangakkara c Tendulkar b Sehwag 103
M Jayawardene lbw b Sharma 48
T Samaraweera lbw b Mithun 0
A Mathews c Laxman b Sharma 41
P Jayawardene lbw b Mithun 27
R Herath not out 80
S Malinga c Harbhajan Singh b Mithun 64
M Muralitharan not out 5
Extras: (b-2, lb-9, nb-5) 16
Total: (eight wickets declared; 124 overs) 520
Fall of wickets: 1-55 2-236 3-259 4-260 5-322 6-344 7-393 8-508
Did not bat: MC Welegedara
Bowling: Sharma 28-5-145-3 (5-nb), Mithun 28-3-105-4, Singh 30-4-98-0, Ojha 28-1-115-0, Sehwag 10-0-46-1