England spinner Moeen Ali took four wickets to bowl Sri Lanka out for 203 and build on their advantage after Ben Foakes’ debut ton in the first test in Galle on Wednesday.
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 pitch.
Moeen took 4-66 in 21 overs and was ably supported by fellow spinners Jack Leach and Adil Rashid who took two scalps each.
The tourists were 38 for no loss at stumps in their second innings, which they gave them a commanding lead of 177 stumps .
Debutant opener Rory Burns, on 11, and Keaton Jennings, on 26, were batting at close of play.
Earlier, England were bowled out for 342 in the morning session after resuming day 2 on 321/8.
Foakes, who was 87 not out overnight, reached his maiden Test ton off 200 balls before being the last man dismissed for 107.
For Sri Lanka off-spinner Dilruwan Perera took 5-75 in 31 overs.