Shaheen Afridi produced a superb six-wicket haul as Pakistan defeated Bangladesh by 94 runs on Friday but saw their increasingly improbable Cricket World Cup bid ended due to the margin of victory.
Following England's win against New Zealand earlier in the week, Pakistan required a record-breaking ODI triumph by more than 300 runs to pip the Black Caps to fourth and last semi-final spot.
And their slimmest of hopes were briefly kept alive as they batted first at Lord's.
But after 100 from Imam-ul-Haq - from exactly 100 balls - and 96 from Babar Azam helped Pakistan to 315-9, their elimination was sealed eight runs into the Bangladesh reply, in which the 19-year-old Shaheen (6-35) came to the fore in spectacular fashion.
Shaheen became the youngest bowler to record a World Cup five-for.
A second-wicket stand of 157 between Imam and Babar had set Pakistan on their way to a consolation victory, with that partnership ended as the latter went lbw to Mohammad Saifuddin.
Imam stuck around for another partnership of 66 with Mohammad Hafeez (27), setting the foundation for Imad Wasim's 43 off 26 as part of a frantic finish to the innings, Bangladesh's Mustafizur Rahman taking 5-75.
Pakistan captain Sarfraz Ahmed, struggling with injury for a time, returned to keep in the Bangladesh innings but, after an opening maiden and a poor early Haris Sohail drop, the score reached 8-0 to seal his side's fate.
The Pakistan bowlers made sure to enjoy the final few hours of their World Cup, though, with Shaheen taking the wickets of Tamim Iqbal (8), Liton Das (32) and then the ever-impressive Shakib Al Hasan (64).
Shadab Khan removed Mosaddek Hossain to halt hopes of a Bangladesh revival, Shaheen then capitalising with a further two wickets in three deliveries to set up a comfortable finish, completed with his sixth.
BABAR PICK OF BATSMEN
The damage had been done for Pakistan prior to this match, but Babar should accept very little of the blame for their early exit. His tournament ended with 474 runs, which is more than any Pakistan player had previously managed at a single World Cup, passing Javed Miandad's 437 in a superb knock at Lord's that included 11 fours.
There was also a batting star in the Bangladesh ranks, however, as Shakib ended his World Cup as the leading run scorer on 606.
SHAHEEN SHINES WITH BALL
Mustafizur had taken three wickets in the final over against India last time out and this time contributed another pair at the same stage for a second consecutive five-for, earning a place on the Lord's honours board.
But Shaheen stole the limelight when it came to exciting young bowlers. His first ODI five-for blew Bangladesh away, and he then took an extra wicket to seal victory and post the best Pakistan figures in the tournament's history.