Pakistan recovered from 28-4 to post 129-7, before Bangladesh reached a winning total of 131-5 in 19.1 overs. Mahmudullah secured victory, and a place in Sunday's final against India, with a deep mid-wicket boundary.
Mahmudullah was unbeaten on 22, but Soumya Sarkar (48) provided the platform for the victory.
Pakistan fast bowler Mohammad Amir had figures 2-26 and kept his side's hope alive until Mashrafe Mortaza (12 not out) hit him for two consecutive boundaries in the 18th over.
Sarfraz Ahmed led Pakistan's comeback with an unbeaten 58. He and Shoaib Malik, who scored 41, combined in a 70-run partnership for the fifth wicket.
Bangladesh fast bowler Al-Amin Hossain claimed 3-25.
Inputs & images: AP