Pakistan shocked England by 14 runs at Trent Bridge on Monday as they ended a long losing streak in one-day internationals despite two centuries for the World Cup host nation.
Joe Root (107) and Jos Buttler (103) were guiding the tournament favourites towards an imposing target of 349 after Pakistan left England needing a World Cup record chase.
The pair put on 130 for the fifth wicket but both were out shortly after reaching their hundreds and the tail had too much to do.
It was a remarkable turnaround for Pakistan, whose opening match of this World Cup had seen then slump to 105 all out in a seven-wicket defeat by the West Indies at the same ground.
That defeat was their 11th straight loss in completed one-day internationals, including the recent 4-0 series defeat by England.
But they started strongly at Trent Bridge on Monday and made 348 for eight, Mohammad Hafeez top-scoring with 84.
No side had previously made more batting second to win a World Cup match than Ireland, with 329 for seven against England at Bangalore in 2011.
England’s chase got off to a bad start when Jason Roy was lbw on the sweep to leg-spinner Shadab Khan to leave them 12 for one.
Jonny Bairstow, whose opening partnership with Roy has been a key factor in England’s rise to number one in the one-day international rankings, then fell for 32 when he was caught behind off Wahab Riaz.
It was the spinners who struck next, England captain Eoin Morgan (nine) bowled by Mohammad Hafeez before Pakistan captain and wicket-keeper Sarfaraz Ahmed held an edged cut by all-rounder Ben Stokes (13) off Shoaib Malik.
But Buttler and Root both hit towering sixes off Hafeez as England accelerated on a pitch where they had twice set the world record for the highest ODI total.
Buttler completed a typically dashing fifty off 34 balls when he pulled Shadab for six as England, who only last month chased down a target of 341 to beat Pakistan in the fourth ODI at Trent Bridge, started to take charge.
Root pulled Hasan Ali for four to go to 97 before his quick single off Riaz saw him to a 15th ODI century in 97 balls, with nine fours and a six.
But he fell soon afterwards, steering Shadab to Hafeez at short third man to end a stand of 130 with Buttler.
Wicketkeeper Buttler, one delivery after completing a 75-ball century, was also caught at short third man when he guided Mohammad Amir to fellow left-arm quick Riaz.
Chris Woakes (21) kept England in the hunt before he was caught behind off Riaz and, at 320 for eight a target of 29 off 12 balls proved too much.
Earlier,Hafeez led a vastly improved Pakistan batting effort that saw Babar Azam (63) and Pakistan captain Sarfaraz Ahmed (55) also making fifties.
Pakistan were undone by a barrage of bouncers against the West Indies and England deployed similar tactics after Morgan won the toss, with their attack featuring recalled fast bowler Mark Wood.
But Pakistan coped and for all the talk about England’s quicks, it was off-spinner Moeen who took the first three wickets.
England, who launched their World Cup campaign with a 104-run thrashing of South Africa, were surprisingly sloppy in the field, while their fast bowlers were expensive -- Jofra Archer’s 10 wicketless overs cost 79 runs.
Pakistan attacked from the start, with openers Fakhar Zaman and Imam-ul-Haq sharing a stand of 82.
Babar completed a run-a-ball fifty while Hafeez pressed on after being dropped on 14 when Roy floored a sitter at mid-off.
Agence France-Presse