Highlights: Mendis hits century as Sri Lanka beat England at Headingley

Second Metro Bank one-day international, Headingley

Sri Lanka 321-6 (50 overs): Kusal 121, Kamindu 54; Ahmed 2-48

England 305-9 (50 overs): Banton 73, Buttler 69; Wellalage 3-49

Jos Buttler's bravery came in vain as Sri Lanka fought back to beat England in the second one-day international at Headingley and set up a series decider at The Oval.

Needing 68 from 75 balls, England were cruising towards a target of 322 until Buttler retired hurt on 67 after tweaking a hamstring.

When Rehan Ahmed, Gus Atkinson and Jamie Overton fell, Buttler re-emerged with 27 needed from 14 balls and witnessed Will Jacks fall for 52 at the non-striker's end.

England were left needing 19 from the last with Buttler on strike but, barely able to hobble a single, he holed out at deep mid-wicket. England finished on 306-9 as Sri Lanka won by 16 runs.

Buttler had earlier shown flashes of his vintage best in hitting Sri Lanka's spinners for five sixes, putting England on course after collapse of 3-14 spoiled an opening stand of 143 between Tom Banton and Ben Duckett.

Sri Lanka were fortunate for the way he was abruptly halted but deserve credit for the way their seamers used reverse swing afterwards to deny England's lower order.

Their captain Kusal Mendis also hit a fine 122 in their 321-6. The series, and the international summer, concludes on Sunday from 10:30 BST.

'The lads wanted me to stick one up him' - Wood relives fastest spells

Sri Lanka level ODI series as England fall short in thriller - as it happened

Best shots - Brilliant Banton gets England off to excellent start

What to make of this dramatic encounter? It is a defeat for England, one which halts their momentum a touch as they build towards next year's 50-over World Cup.

It was unlike any other, however. They will do well to find situations like these again when the bigger moments come.

"It is always disappointing when you lose," captain Harry Brook said.

"Sri Lanka played exceptionally well there, especially the last 10-15 overs. There were plenty of moments in the game we could have been slightly better."

One positive was the batting of Buttler before injury struck. He has not scored a century in this format for three-and-a-half years and had his T20 form doubted earlier this year at the World Cup.

The way he took down the spinners was brutal. When he was flying, England were on course for their highest chase at this ground.

The opening stand between Banton and Duckett was also impressive - reminiscent of England's brightest ODIs days as they thrashed around the bowling at more than seven runs an over.

That neither pressed on - Duckett was bowled for 67 and Banton stumped for 73, both to left-arm spinner Dinuth Wellalage - was disappointing. There were also rare failures for Joe Root who made 15 and Brook, the latter also pinned in front lbw for one by Wellalage.

Perhaps more concerning was that the lower order were unable to support Jacks in his quest to push England over the line again.

That aspect must improve over England's three white-ball series that come before mid-January.

'Fabulous knock' - Watch the best shots as Mendis reaches 100

This has been a difficult tour for Sri Lanka, who were outclassed in the 3-0 T20 series defeat and well beaten by 89 runs in the first ODI at Chester-le-Street.

This, especially given the bad start with the ball, will be a significant boost to morale.

Kusal was troubled early on by Overton's bouncers, top-edging one into a gap soon after Atkinson dropped a simple chance at fine leg when the right-hander had 17 - another England error. The Sri Lanka captain also had to overturn a caught-behind decision on 99 when Overton was the bowler again.

Kusal was eventually caught on the boundary trying to clear deep mid-wicket off Ahmed, who also had Charith Asalanka caught in the same position for 2-48 but did not offer the control usually brought by Adil Rashid.

A flat Headingley pitch was a far bigger test of England's seamers than Tuesday's difficult surface in Durham.

Josh Tongue struggled with his lines for 0-50 in seven overs. Atkinson, who took 2-55, and Overton, who had another catch dropped in the final over, in taking 0-63 from 10 were England's best bowling performers.

"Tight games are always good games to watch and good games to be a part of," Brook added.

"Having the opportunity to play in a decider will only benefit us."

Notifications, social media and more with BBC Sport