New Zealand have been confirmed as World Cup semi-finalists after Pakistan failed to beat Bangladesh by at least 308 runs in their final group game.
Batting first, Pakistan needed the largest winning margin in the history of one-day internationals to overhaul the Black Caps on net run-rate.
They made 315-9 but could not reach the semi-finals once Bangladesh reached 8-0 in the second over of their chase.
New Zealand are confirmed in the last four with Australia, India and England.
England will finish third and New Zealand fourth, with the group winners to be decided on Saturday.
Leaders Australia will top the group if they beat South Africa at Old Trafford (13:30 BST) but if the defending champions lose, India can overtake them by defeating Sri Lanka at Headingley (10:30 BST).
Pakistan were thrashed by West Indies in their first game of the World Cup but recorded wins over England, New Zealand, Afghanistan and South Africa to move above England into fourth, before the hosts’ wins over India and New Zealand put them through.
They needed to bat first against Bangladesh at Lord’s on Friday to have a theoretical chance of taking fourth spot in the group. A win of at least 308 runs would have seen them go level on 11 points with New Zealand and then above them on net run-rate.
Pakistan captain Sarfaraz Ahmed won the toss and, after a cautious start, 100 from Imam ul-Haq and 96 by Babar Azam saw them reach the minimum required total in the 49th over of their innings.
But Pakistan’s exit was confirmed when Bangladesh’s Tamim Iqbal scored a single off Mohammad Amir’s fifth delivery.