Adil Rashid and Ben Stokes bowled England into a dominant position in the third Test at the end of a day controlled for so long by Sri Lanka.
A partnership of 142 between Dimuth Karunaratne (83) and Dhananjaya de Silva (73) had taken the hosts to 173-1 as tea approached, well on the way to overhauling England's first-innings 336.
However, Rashid broke the stand and with the leg-spinner producing a fine spell at one end and Stokes (3-30) sending down some ferocious short-pitched bowling at the other, Sri Lanka crumbled to 240 all out.
Rashid ended with career-best figures of 5-49 as the last nine Sri Lankan wickets fell in the space of 111 deliveries for only 67 runs. England were 3-0, a lead of 99, at stumps.
The day began with England 312-7 and it soon became apparent that a decision had been made that the runs would come quickly or not at all, with Moeen Ali and Jack Leach dismissed playing big shots to Dilruwan Perera and Stuart Broad bowled round his legs by Lakshan Sandakan (5-95) in between.
There was early frustration for England when Sri Lanka began their reply as Joe Root dropped Karunaratne with the opener on just two, Broad the bowler.
The breakthrough eventually came thanks to some fine work by Keaton Jennings at short leg - not for the first time in the series and not for the last in the day.
He stayed with Danushka Gunathilaka as the batsman advanced to Leach, stayed up bravely and earned his luck as the ball took the inside edge, popped up off the pad and hit him in the stomach.
Leach and Ali threatened to expose the middle-order early but Karunaratne and Dhananjaya battled through and were scoring freely by lunch.
Dhananjaya, on 42, was given a reprieve after lunch as Root shelled another catch off Broad and as the second-wicket partnership continued to grow, the two drops began to look increasingly costly.
Both batsmen passed 50 as Sri Lanka were able to enjoy their first century stand of the series before Dhananjaya's soft dismissal - turning a Rashid delivery to leg and straight into the grateful hands of Jennings - gave England an opportunity.
They seized it with both hands. Stokes began his fiery spell before tea but it was Rashid, in the first over after the break, who removed Karunaratne 17 short of a century; Jennings again the catcher just behind square.
From there the wickets came quickly, Angelo Mathews (5) cue-ended a Stokes bumper behind and Ben Foakes took another catch off the seamer when Niroshan Dickwella (5) feathered one down the legside.
Sandwiched in between was Rashid's third, although much of the credit should go to Jennings, who stuck out his left hand to take a stunning catch as Roshen Silva inside-edged a googly into the legside.
Rashid and Stokes combined to have Kusal Mendis (27) caught behind, Stokes bounced out Dilruwan (0) and Rashid ran out Sandakan (2) with a direct hit later that over.
It was left to the leggie to wrap up the innings, trapping Malinda Pushpakumara (13) lbw.
Rory Burns and Keaton Jennings survived four overs in the fading light before the umpires took the players off with England superbly placed to push on and claim a 3-0 series whitewash.
Watch day three of the third Test between Sri Lanka and England from 4.15am, Sunday on Sky Sports Cricket and Main Event.