Spinner Taijul Islam claimed four wickets as Bangladesh moved within three wickets of a series sweep against Pakistan on day four of the second Test in Sylhet.
Chasing an improbable 437 for victory, Pakistan were reduced to 7-316 by stumps on Tuesday.
No.7 batter Mohammad Rizwan, on 75, was the last realistic hope for the visitors, with Sajid Khan with him on eight.
Salman Agha and skipper Shan Masood added 71 runs each to help Pakistan take the Test to a fifth day.
Left armer Taijul put Bangladesh on top, breaking the threatening partnership of Agha and Rizwan, who shared 134 runs for the sixth wicket to give Pakistan a glimmer of hope.
Taijul bowled Agha with a slider to break the stubborn rearguard before removing Hasan Ali for duck.