Pakistan beat Bangladesh by 94 runs at Lord's but only to finish the tournament with four straight wins and ultimately paying the price for a sluggish start.
Pakistan thumped Bangladesh by 94 runs in their last World Cup group match on Friday but suffered a painful exit as New Zealand pipped them to a semi-final place on net run-rate.
Sarfaraz Ahmed's team needed to smash the world record for margin of victory in a one-day international but a miracle win never looked remotely likely at a sun-drenched Lord's.
Pakistan's total of 315 for nine meant Bangladesh needed only eight runs to end the 1992 world champions' hopes of advancing to the semi-finals.
Teenager Shaheen Afridi returned the best-ever figures for Pakistan at a World Cup of 6-35 as they finished level on 11 points and games won (five) with fourth-placed New Zealand, missing out on 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.
Shaheen Afridi appreciation post 🤩— Cricket World Cup (@cricketworldcup) July 5, 2019
👉 16 wickets at #CWC19
👉 Youngest to take a five-for at a World Cup
👉 Most wickets by a teenager in World Cups
👉 Best figures by a Pakistan bowler at a World Cup pic.twitter.com/8OUJIdsjtY
'One match cost' Pakistan dear
"Unfortunately we played very good cricket in the last four matches but we have not qualified," said Sarfaraz.
"Only the one match will cost us in the whole tournament (against West Indies). We played very good cricket."
Pakistan, backed by thousands of passionate flag-waving fans in London, 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.
Sit back, relax and enjoy @iShaheenAfridi in full flight.— ICC (@ICC) July 5, 2019
No longer a 'player of the future' - the Pakistani speedster has well and truly arrived! Watch @TheRealPCB wickets here, including 6️⃣ of the best from this young man 👏#WeHaveWeWill | #CWC19 pic.twitter.com/tK1u6gw3uz
Shakib run glut
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 man-of-the-match Shaheen doing most of the damage with his left-arm seam.
Watch the best shots from the @BCBtigers innings as Bangladesh signed out of #CWC19 pic.twitter.com/Kr3VoQ9ouW— ICC (@ICC) July 5, 2019
Poor run rate
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 the seventh spot with three wins in their nine matches.
Bangladesh skipper Mashrafe Mortaza said: "We feel very sorry for Shakib that we couldn't support him all through the tournament, otherwise things could have been very different. He has been fantastic."