Sri Lanka took control of the second test after Dhammika Prasad claimed four wickets on day four to reduce England to 57-5 today, needing an unlikely 293 more runs to win at Headingley.
Sri Lanka were earlier dismissed for 457, setting England an imposing total of 350. The highlight of their innings came from captain Angelo Mathews, who led from the front to fire a career best 160, his fourth test century.
Mathews was quick to highlight Mahela Jayawardene's 79 and Rangana Herath's 48. ''After the first couple of days, nobody thought we would be in this position,'' Mathews said.
''We had to fight really hard. I thought Mahela Jayawardene was fantastic and Rangana Herath, he played a blinder. Obviously Dhammika Prasad bowled really well, he got us the four wickets which is crucial because we are sitting pretty.''
While Mathews made his second century of the series, opposing captain Alastair Cook again failed to get going with the bat. England had reached 39-0 when he cut a wide delivery from Prasad into his middle stump, having made 16 runs.
Prasad then dismissed Gary Ballance (0) lbw with a brilliant delivery that curved inwards and was on a hat-trick. Ian Bell momentarily dented his momentum, playing a high ball off for a single.
But Prasad hadn't finished. Sam Robson, who had been looking comfortable at the crease after his first innings 127, edged to Jayawardene at second slip on 24. Jayawardene moved third in the list of all-time test catches on 197.
Prasad, sensing England's panic, then knocked out Bell's off stump for eight. England sent in nightwatchman Liam Plunkett to negotiate the final 15 minutes, but he fell to Rangana Herath on 0 while unwisely trying to score off the last ball.
Bell, who is playing his 100th test, felt England had paid the price for its first-innings collapse from 311-3 to 365 all out on day two.
''It shows in test cricket, when you play against quality teams like Sri Lanka with world class players, if you don't recognise those key periods and bury teams, they are going to come back at you,'' Bell said.
''They showed us tonight that when you get on top and people are down, you keep them down.''
Sri Lanka managed to bat through two sessions of the day. Mathews held the innings together with a methodical knock, often looking to take a single from the final two balls of an over to protect Herath's wicket and build a score.
He lost concentration, however, on the final ball before tea. Looking for a quick single to bring up his 150, he was late in sending back Herath and Joe Root ran him out with a direct hit from mid-on.
''I thought Joe was a little bit deeper than he was and obviously Rangana didn't have much time,'' Mathews said.
Herath's dismissal was the only wicket to fall in an otherwise perfect second session for Sri Lanka.
Mathews, who built a partnership of 149 with Herath, went shortly after tea when he hit a full toss to Moeen Ali at square leg off the bowling of James Anderson.
Anderson then bowled Nuwan Pradeep (0) to close the innings, after Shaminda Eranga had fired 20 runs from 19 balls.
Liam Plunkett took two wickets in two balls in the morning session and was on a hat-trick. It was the second time in as many innings Plunkett was bowling a hat-trick ball but Mathews denied him by pulling a short ball for a single.
Anderson made the breakthrough for England, ending Jayawardene's knock of 79 but the day belonged to the tourists as they close in on winning a test series in England for the first time.
''It will be a successful tour for us if we can pull it off,'' Mathews said. ''It is only half done and we need to take those five wickets as soon as possible.''
Should bouncers be banned from cricket?