Moeen Ali led England's resistance with an unbeaten 108. © AFP

Moeen Ali led England's resistance with an unbeaten 108 even as Sri Lanka won by 100 runs off the penultimate ball of the day. © AFP

Sri Lanka beat England with just one ball to spare to win the second Test at Headingley by 100 runs on Tuesday (June 24), and so take the two-match series 1-0.

There were more than 20 overs remaining when James Anderson, England’s No.11, walked out to bat. But he survived for 55 balls on nought until, off the penultimate delivery of the match, he gloved Shaminda Eranga to Rangana Herath at leg gully.

Just as Sri Lanka had staved off defeat by one wicket in the drawn first Test at Lord’s, it seemed England might do likewise in Leeds. But Nuwan Pradeep, Sri Lanka’s No. 11 batsman, had to survive for only five deliveries at Lord’s.

Anderson had defied Australia’s attack for 53 balls when England clung on for a draw with one wicket standing in the 2009 Ashes Test in Cardiff, and he very nearly did the same on this occasion.

Defeat was tough on Moeen Ali who batted for six-and-a-half hours while making 108 not out — his maiden Test century.

England, set 350 for victory, were bowled out for 249 as Sri Lanka won a Test on English soil for only the third time in their history following victories at The Oval in 1998 and Trent Bridge in 2006.

England resumed on 57 for 5, having collapsed in the face of Dhammika Prasad’s dramatic burst of four wickets for 15 runs on Monday.

It was all a far cry from when England were 311 for 3 after tea on the second day of this Test, thanks to Sam Robson’s maiden Test century, and even when they reduced Sri Lanka to 277 for 7 on Monday — a lead of just 169.

But Angelo Mathews, the Sri Lanka captain and the Man of the Match, responded with a superb Test-best 160 and a key eighth-wicket stand of 149 with Rangana Herath, who made a valuable 48.

Mathews’s hundred, his second of the series, followed his Test-bowling return of 4 for 44 earlier in this match.

Overnight, Joe Root was 6 not out, with Ali yet to come in. The pair kept Sri Lanka at bay for more than two hours on Tuesday. But Pradeep made the breakthrough when Root, aiming legside, was caught in the gully by Lahiru Thirimanne for 31. Prasad, whose final figures of 5 for 50 were his best in Test cricket, struck again to remove Matt Prior, the England wicketkeeper.

Last year Prior took his side to an unlikely Test draw in Auckland by repelling New Zealand for 54 overs. But on Tuesday, he lasted for just 37 balls, being undone by a lifting delivery from Prasad that was well caught at short leg by Kaushal Silva.

However, Billy Bowden asked Paul Reiffel, the third umpire, to check for a no-ball. It was a desperately close call but Reiffel ruled in Sri Lanka’s favour, and England were 160 for 7 with Prasad able to celebrate taking five wickets in a Test innings for the first time.

At tea, England were 173 for 7, needing to bat for a minimum of 40 more overs — and with the new ball on the horizon. Chris Jordan, reprieved off a no-ball review given in England’s favour on 12, then fell lbw to Herath for 21 to leave England 212 for 8.

Stuart Broad hung around for 24 balls before he too was lbw to Herath (3 for 59) for nought to leave England on the brink of defeat at 228 for 9.

Anderson though refused to yield while an unflustered Ali went to a 259-ball century with his 16th four, a leg-glance off Pradeep. But Ali, 27, could only watch as Eranga, with the penultimate ball of the match, took his only wicket of the innings to seal Sri Lanka’s dramatic success.

Defeat condemned a new-look England to another Test series loss following their 5-0 Ashes whitewash in Australia.