Pakistan thumped Bangladesh by 94 runs in their final World Cup group match on Friday but it was not enough to earn them a place in the semi-finals as New Zealand went through on net run-rate.
Sarfaraz Ahmed's team needed to smash the world record for margin of victory in a one-day international after winning the toss to keep the dream alive, but a miracle win never looked remotely likely at a sun-drenched Lord's.
Their total of 315 for nine meant Bangladesh needed only eight runs to end Pakistan's hopes of progress at the tournament and they reached that in the second over.
Teenager Shaheen Afridi took six wickets as Pakistan won the game easily to finish level on 11 points and games won (five) with fourth-placed New Zealand, leaving them outside the top four due to their inferior run-rate.
The other teams in next week's semi-finals are Australia, India and hosts England, with the final group matches taking place on Saturday.
Pakistan, backed by thousands of passionate flag-waving fans, started curiously slowly, crawling to 38-1 after 10 overs.
Imam-ul-Haq (100) and Babar Azam (96) eventually stepped on the gas, reaching their 150 partnership for the second wicket off 146 balls but both fell in quick succession to suck the momentum out of their innings.
A late flourish from Imad Wasim, who scored 43 runs from 26 balls, boosted the score but Pakistan lacked the muscle to put themselves out of sight. Mustafizur Rahman took five wickets for Bangladesh, including a superb caught and bowled to dismiss Shadab Khan.
In reply, Shakib Al Hasan (64) scored his seventh fifty of the World Cup to shoot to the top of the tournament's run-scoring charts, with 606 runs at an average of more than 86.
His seven scores of fifty-plus equal the record set by India's Sachin Tendulkar at the 2003 tournament.
But Bangladesh lost wickets at regular intervals and were bowled out for 221 in the 45th over, with teenager Shaheen returning the best-ever figures for Pakistan at a World Cup of 6-35.
Pakistan paid a heavy price for a slow start to their World Cup campaign, winning just one of their first five matches.
They were shot out for a paltry 105 in their first match, with the West Indies winning in just 13.4 overs, meaning they took a huge hit on run rate.
They came back strongly to beat South Africa, New Zealand and Afghanistan to sit fifth in the 10-team table, but in the end left themselves too much to do.
Bangladesh ended the 10-team group phase in seventh spot with three wins in their nine matches.-AFP
Scoreboard
==========================================
Pakistan
==========================================
F. Zaman c Mehidy b Saifuddin 13
I. Haq hit wicket b Mustafizur 100
B. Azam lbw b Saifuddin 96
M. Hafeez c Shakib b Mehidy 27
H. Sohail c Soumya b Mustafizur 6
I. Wasim c Mahmudullah b Mustafizur 43
S. Ahmed not out 3
W. Riaz b Saifuddin 2
S. Khan c and b Mustafizur 1
M. Amir c Mushfiqur b Mustafizur 8
Shaheen Shah Afridi not out 0
==========================================
Extras: (lb3, nb1, w12) 16
==========================================
Total: (9 wkts, 50 overs) 315
==========================================
==========================================
Bangladesh
==========================================
T. Iqbal b Shaheen 8
S. Sarkar c Fakhar b Amir 22
S. Al Hasan c Sarfaraz b Shaheen 64
M. Rahim b Riaz 16
L. Das c Sohail b Shaheen 32
Mahmudullah b Shaheen 29
M. Hossain c Babar b Shadab 16
M. Saifuddin c Amir b Shaheen 0
M. Hasan Miraz not out 7
M. Mortaza st Sarfaraz b Shadab 15
Mustafizur Rahman b Shaheen 1
==========================================
Extras: (lb5, w6) 11
==========================================
Total: (all out, 44.1 overs) 221
==========================================