Spinners Mehidy and Shakib lead Bangladesh to maiden Pakistan Test win
Mehidy grabbed 4-21 and Shakib 3-44 to trigger a Pakistan collapse on the fifth day, with the home side dismissed for 146 runs in 55.5 overs.
That left Bangladesh a target of just 30 runs, which openers Zakir Hasan and Shadman Islam reached in 6.3 overs.
Zakir (15) hit the winning boundary, with Shadman at the other end unbeaten on nine, as their squad celebrated a memorable victory.
Mohammad Rizwan top-scored for Pakistan in the second innings with 51, including six boundaries, but the home team were staring at defeat on 108-6 at lunch.