Pakistan were eyeing victory as they closed day four of the second and final Test against Bangladesh in Dhaka still 18 runs ahead needing five more wickets to claim the win.
After being bowled out for 470 in reply to Bangladesh's 338, they reduced the hosts to 114 for five at stumps to put themselves in a dominant position heading into the final day.
A brace of wickets from quick bowlers Umar Gul and Aizaz Cheema rocked the home side after Misbah-ul-Haq (70) and Adnan Akmal (53) had completed half-centuries to secure a first-innings lead.
Shakib Al Hasan impressed by taking six for 82 to limit the damage but the Bangladesh top order then crumbled, with the exception of Nasir Hossain, who is unbeaten on 30 in 63 balls.
Any hope of an escape for Bangladesh rests with him and his captain, Mushfiqur Rahim, who is unbeaten on seven.
Centuries in the game so far for Shakib (144) and Taufeeq Umar (130) had suggested the game might drift towards a draw before Pakistan's bowlers turned the game dramatically in their favour.
Pakistan lead the series 1-0 after an innings-and-184-run win in the opening Test in Chittagong.
© Cricket World 2011
Open an account with bet365 today and qualify for up to £200 in free bets with our fantastic 100% Deposit Bonus.