Only in Test cricket could a batsman face 55 balls without scoring a single run yet still come desperately close to becoming the hero before having his moment of glory cruelly snatched away with just one delivery remaining.

Such was the fate of Jimmy Anderson in an extraordinary finish to the second Test at Headingley on Tuesday night as Sri Lanka claimed their historic first series victory in England despite a dramatic rearguard that so nearly denied them.

Anderson, the man who held firm in Cardiff five years ago to deny Australia, repelled everything Sri Lanka threw at him in a last wicket stand with Moeen Ali that seemingly earned a draw that had long appeared out of England’s reach.

Yet just as it seemed all the hard work had been done, just as it appeared that England would get out of a huge hole of their own making, Shaminda Eranga had the final glorious word for Sri Lanka.

Scroll down for videos

Devastated: Moeen Ali goes over to console James Anderson who was dismissed for a duck off 55 balls

The end: James Anderson leans on his bat as Sri Lanka go into raptures after his wicket wins them the series

Pulling stumps: Sri Lanka players celebrate winning their first series in England

Just as the first Test had gone down
to the final ball before the match was drawn this one lasted until
7.07pm and the penultimate ball of the final over before this Investec
series finally swung decisively in Sri Lanka’s favour.

Anderson,
who had joined the mighty Moeen with 122 balls remaining and the Test
all but lost, was barely troubled until Eranga delivered a short pitched
brute of a delivery that Anderson could only fend off gently to Rangana
Herath.

The leader of
England’s attack held his head and sank to his knees, just as Stuart
Broad had done when he could not force a victory at Lord’s, and was in
tears afterwards at the post-match presentation. He could have done no
more.

England had come
so, so close to becoming the first side to bat through the final day of a
Test having begun it five wickets down but ultimately had to face up to
the harsh reality of losing an early summer series for the first ever
time.

This was a
heart-wrenching way to sink to a defeat but the way England held out so
doggedly for so long will only increase their sense of frustration at a
Test and a series they simply threw away.

Ten
chances in all were squandered in this match by England who also wasted
a position of dominance with the bat in the first innings and then
crashed to 57 for five on the penultimate evening when chasing a
theoretical 357.

VIDEO I'm gutted for Jimmy and the lads - Moeen

Understated: Moeen Ali doesn't even remove his helmet in celebration of his maiden Test century as he pushed to save the match for England

Job to do: Moeen simply raised his bat and was congratulated by James Anderson after reaching the milestone

Padded away: Anderson shows no interest in scoring lasting more than 50 without getting off the mark

Under pressure: Tailender Anderson is crowded by Sri Lanka fielders as they fought for the final wicket

Their
gallant failure should not be allowed to mask those shortcomings and the
grim reality that they have suffered a massive setback in their quest
to start afresh after the winter horrors of Australia.

Yet when the
dust settles on what should be recognised as a significant triumph for
Sri Lanka, England will take huge consolation in the performances of the
new players who have all made an impact throughout two long, hard
Tests.

None more so than Moeen, who was simply brilliant in scoring
his maiden Test century in the most difficult of circumstances and
displayed both a calmness and pure elegance of strokes that mark him out
as a new star of English cricket.

It was hard to believe that Moeen
was playing in just his second Test, such was the maturity and skill
with which he marshalled the England defence throughout the final day
and so nearly towards a joyous conclusion.

On his way: Matt Prior was dismissed for 10 when he was caught by Kaushal Silva off Dhammika Prasad

Resistance: Joe Root was the first wicket to fall on day five when he fell for 31 off 108 balls

Chin music: Root is struck by a short ball during a hostile morning spell from Sri Lanka's seamers

Chat: Root and Herath exchange words during play on day five at Headingley

Any concerns that he may
not be good enough to be a specialist spinner – and he is a much better
bowler than even England seem to realise – should be shelved. This
impressive character is good enough as a batsman alone.

A sparse
crowd of barely 2,000 here at Headingley turned up more in hope than
expectation as Moeen joined Joe Root at the start of the final day with
seemingly only the full extent of England’s humiliation to be decided.

And
it quickly became clear that the bad feeling between these sides that
began with the reporting of Sachithra Senanayake for throwing had
reached boiling point, with Sri Lanka taking their verbal attack on Root
to the limits.

When Nuwan Pradeep finally found a way past Root Sri
Lankan joy knew no bounds but there was to be more controversy in the
form of two no balls, one that was given and one that was not before the
Test was eventually settled.

Firstly, when Matt Prior was bounced
out, a technological check on Dhammika Prasad’s front foot found him
perilously close to being in front of the line. TV umpire Paul Reiffel
gave the benefit of the doubt to the bowler, a novel twist on an old
cricketing tradition introduced in their wisdom by the ICC.

Valiant: Moeen Ali led England's hopes of saving the match on the final day showing his class with the bat

Hitting out: Moeen shows some aggression with a blow to mid-wicket on a day where survival was the key

Yet when
Chris Jordan was caught off Eranga an apparently identical foot position
this time led to a no ball call and a reprieve for the batsman.
Confused? Address all your inquiries to a Mr D Richardson of the ICC in
Dubai.

Jordan did not hang around to take advantage of his let-off
and when Stuart Broad was trapped by Hearth the ball after refusing a
single England’s fate looked complete. Yet there was so nearly a final
barely believable twist.

Alastair Cook will have gone through every
emotion over two contrasting final days of this series but this will
have increased his resolve to silence the doubters by fighting on
against India, starting at Trent Bridge on July 9.

He has seen his
side lose this series despite three batsmen in Moeen, Sam Robson and
Gary Ballance all scoring their maiden hundreds in only their second
Test and Liam Plunkett return to Test cricket with a nine-wicket haul
here.

There is promise for England but there is also the harsh
reality that the captain needs both runs and victories and he needs them
very quickly.

Wet: The morning session in Leeds was curtailed by rain and forced an early lunch to be taken

Words of advice? Under fire England captain Alastair Cook talks to Andrew Strauss before play