Moeen Ali's brilliant maiden Test century proved cruelly in vain for England as James Anderson fell to the penultimate ball against Sri Lanka on the final evening at Headingley.

Anderson was bounced out, looping a catch to leg gully off Shaminda Eranga, as England were bowled out for 249 to lose by 100 runs - and Sri Lanka, after all, recorded their first Test series victory in this country.

By then, it seemed England - like the tourists at Lord's last week - were about to hang on for a famous stalemate after Anderson kept out 54 balls, having joined Moeen (108no) with 20.2 overs remaining.

Moeen, in only his second Test, kept Sri Lanka at bay for more than six hours by batting out the whole of the last day before leaving the final over to his number-11 partner.

Eranga had the last say, though, after Dhammika Prasad (five for 50) and Rangana Herath (three for 59) had done the most damage.

The nail-biting outcome therefore does nothing to ease the pressure on the captaincy future of Alastair Cook, who led England to Ashes whitewash in Australia and was a notable survivor in his central role despite a management reshuffle around him.

England began the final morning here already 57 for five, and apparently with precious little hope of denying Sri Lanka.

That they almost did so was great credit to Moeen, yet the bottom line is that they have begun their new era after last winter's woes with a 1-0 series defeat.