Roshen Silva hit a stubborn 85 to guide Sri Lanka to a 46-run first innings lead over England in the second Test on Thursday.
The hosts, down 1-0 in the three-match series, were bowled out for 336 in reply to England's 290. England's Rory Burns and tail-ender Jack Leach had to see out one nervy over before the end of the second day in Kandy.
After Adil Rashid struck twice to England's tourists' hopes of securing a lead on the turning pitch, Silva built crucial partnerships including a 56-run ninth wicket stand with Akila Dananjaya as the hosts edged past England's total.
Dananjaya frustrated England's spinners before falling to Moeen Ali leg before for 31. Stand-in skipper Suranga Lakmal was unbeaten on 15 at the end.
The visitors were yet to open their account after nightwatchman Jack Leach faced six balls from Dilruwan Perera in the final over of the day. Rory Burns was accompanying Leach at close of play.
"We had a chat upstairs -- a little bit disappointed that they've got a little bit of a lead," said Leach, who also took three wickets in Sri Lanka's innings.
"We're very much feeling good about the fact that we're bowling last on that wicket. We feel if we can put pressure on tomorrow with our batting and get a good total, we feel that we can win the game," he said.
England had made inroads into the Sri Lankan middle order through some brilliant fielding by Ben Stokes before lunch but Silva frustrated the opposition bowlers for the rest of the day.
Dimuth Karunaratne, who made 63, put on 96 for the third wicket with Dhananjaya de Silva, who hit 59, to steady the innings after they had slipped to 31 for two early in the day.
But Stokes, who on Wednesday had failed with the bat as England's new number three, broke the partnership when he pounced to run out Karunaratne with a direct throw from gully.
The star all-rounder then took a stunning one-handed catch low to his left at first slip to dismiss Kusal Mendis for one off the slow left-arm spin of Leach.
"We got a 46 runs lead, its a huge score for us when they play in the second innings. We can put them under pressure if we can get a couple of wickets early morning," said Karunaratne.
"If we can get England before 250 it will be a gettable target for us," he added.
England's first innings total was 285 but Sri Lanka were docked five runs after the umpires deemed that Silva did not ground his bat properly while taking a run.
According to international cricket rules an umpire can dock five runs if he feels the batsman ran a short run deliberately.
"I don't think Roshen did it deliberately. He thought the ball had gone for four he came back to his partner to give a high five," said Karunaratne.
"Those things can happen its part of the game we don't blame him. We are not so worried about the five runs."