Shahid Afridi bludgeoned the Bangladesh bowlers during a 25-ball 59 to script Pakistan's highest ever run chase as his team beat the hosts by three wickets with one ball to spare to set up an Asia Cup final against Sri Lanka.
Chasing 327 for victory, opener Ahmed Shehzad (103) gave Pakistan a solid start with his fifth ODI century but it was left to Afridi's pyrotechnics to cement the win as the right-hander hit seven sixes and two fours during his innings, his half-century coming off just 18 balls.
Afridi, who hit two consecutive sixes in the last over during Pakistan's win against arch-rivals India on Sunday, suffered from cramps towards the end and was run-out to a direct hit by Shakib Al Hasan with Pakistan needing 33 off 19 balls.
Fawad Alam (74) was also run out in the final over but his two sixes off left-arm spinner Abdur Razzak had sealed the win for Pakistan, whose highest successful run chase till date was in a 2007 ODI against India when they made 322-6.
Earlier, determined to register their first win in the tournament, Bangladesh made five changes to their squad and their top order fired in unison to help them post 326 for three, their highest ODI total in front of a delirious crowd at Mirpur's Shere Bangla National Stadium.
Opener Anamul Haq (100) hit his second ODI century, while Imrul Kayes (59) and Mominul Haque (51) chipped in with brisk half-centuries to lay the foundation for a big total against Pakistan's off-colour attack.
Skipper Mushfiqur Rahim (51) and all-rounder Shakib (44) added 77 quick runs in 5.4 overs and remained unseparated to take the hosts past the 300-run mark.
Pakistan left-arm spinner Abdur Rehman sent down a hat-trick of illegal full tosses and was taken out of the attack with bizarre bowling figures of 0-0-8-0.
Mushfiqur took the onus on himself to negate the threat posed by Pakistani off-spinner Saeed Ajmal who conceded 52 runs in his last four overs.
Bangladesh milked 121 runs off the last 10 overs with Shakib hitting six fours and two sixes during his unbeaten 16-ball blitz.
Bangladesh's previous highest score was 320-8 against Zimbabwe in a 2009 one-dayer in Bulawayo.