Sri Lanka captain Angelo Mathews and paceman Dhammika Prasad pushed England to the brink of defeat as the home side, set 350 to win, slumped to 57 for five on the fourth day of the second and final Test on Monday.
Mathews stroked a magnificent 160 to help Sri Lanka power their way to a second-innings total of 457 at Headingley after resuming on 214 for four.
Paceman Liam Plunkett claimed two victims in two balls for the second time in the game as he added figures of four for 112 to his first-innings haul of five for 64.
Prasad then produced a fiery spell of fast bowling to rip the heart out of England's batting by removing skipper Alastair Cook (16) and Gary Ballance (duck), in consecutive balls, Sam Robson (24), Ian Bell (eight) and nightwatchman Plunkett for another duck.
England, trailing by only 106 runs, seemed to have the upper hand at the start of the day but Mathews and Mahela Jayawardene wrested away the initiative by scoring freely in the opening hour.
James Anderson lifted England when he tempted Jayawardene (79) to offer an edge to keeper Matt Prior before Plunkett accounted for Dinesh Chandimal (seven) and Prasad (duck) in consecutive balls.
Mathews seized the moment and, together with Rangana Herath, he put Sri Lanka on top.
After being dropped by Plunkett on 87, Mathews reached three figures with a cut through the off side.
Herath also went on the attack with a series of lusty pull shots and hard-hit drives as the pair put on 149 for the eighth wicket.
Joe Root ended the partnership when he threw down the stumps at the non-striker's end with a direct hit, removing Herath for 48.
A four through extra cover carried Mathews past his previous Test-best 157 not out but he was out to the next delivery, spooning the ball straight to Moeen Ali off Anderson who finished with figures of three for 91.
England's batsmen made a good start with the openers putting on 39 for the first wicket.
Cook's dismissal, after he dragged an attempted pull on to his stumps, triggered a collapse.
Ballance was trapped lbw by Prasad off the next ball before Bell thwarted the hat-trick bid.
Prasad would not be denied for long, forcing Robson to edge to Jayawardene in the slips, clean bowling Bell and dismissing Plunkett when the nightwatchman lobbed a tame catch to Nuwan Pradeep at extra cover to end play for the day.
Root was six not out when stumps were drawn. The first Test at Lord's ended in a draw.
Image: Angelo Mathews lifts his bat after completing his century
Photograph: Dave Thompson/Getty Images