England spinners led by Moeen Ali helped dismiss Sri Lanka for 203 and build on their advantage after wicketkeeper-batsman Ben Foakes' debut ton in the first Test in Galle.
The hosts conceded a 139-run lead in response to England's 342 after being bowled out in the final session of play on day two on a turning Galle pitch notorious for its low scores.
Ali claimed four wickets and was ably supported by fellow spinners Jack Leach and Adil Rashid, who took two each.
England were 0-38 at stumps in their second innings, stretching their lead to 177 runs. Debutant Rory Burns, on 11, and Keaton Jennings, on 26, were batting at close of play.
"(It was) a great day for us,” said Leach, who made an impact with his left-arm spin in just his second Test for England.
“It was always nice for a spinner to get some purchase on a wicket like this, I got into things quite early on.
"Moeen has been great to be around and good banter when he's around in the change room.
"We are enjoying it … Jimmy (Anderson) and (Sam) Curran bowled really well at the top and took the pressure off us.”
But it was Foakes who stood out with his patient yet effective batting in England's first innings to give his side a challenging total after electing to bat first.
The 25-year-old Foakes, who replaced injured Jonny Bairstow, converted his overnight 87 to 107 in the morning session to become only the fifth wicketkeeper-batsman to score a hundred in his first Test.
For Sri Lanka, Angelo Mathews top-scored with 52 and put on a crucial 75-run stand for the fifth wicket with skipper Dinesh Chandimal, who made 33, to frustrate the opposition bowlers.
Rashid broke the key stand after getting Chandimal stumped, but Mathews went on to register his 30th Test fifty.
But he did not trouble the scorers after the tea break as Ali had the dangerman trudging back to the pavilion in the first over of the final session.
Dilruwan Perera, who picked up five wickets in the England innings, crossed 1000 Test runs on his way to 21. He became the fastest Sri Lankan to claim a double of 100 wickets and 1,000 runs.
The biggest cheer of the day was reserved for the retiring Rangana Herath who walked in amid a rousing reception as the English team lined up to receive the spin legend in the middle.
He remained unbeaten on 14 after Rashid got the final wicket Suranga Lakmal for 15.
"I have watched Herath over the years, he's been a legend for Sri Lankan cricket," Leach said in praise of the veteran left-arm spinner.