Off-spinner Sajid Khan claimed a career-best 6-35 as Pakistan reduced Bangladesh to 76-7 and produced a glimmer of hope of forcing a result in the second and final Test, at Shere Bangla National Stadium, Mirpur, on Tuesday.
After day three was washed out, Pakistan resumed the fourth day from 188-2 and declared at 300-4 after lunch.
Then spinners Sajid and Nauman Ali got to work until stumps was called an hour early because of bad light.
Bangladesh trailed by 224 runs and still needed 25 runs to avoid the follow-on at the end of a dramatic day.
"After the declaration, our target was to give us the best chance to win the game and attack relentlessly and that's what we did,” Sajid said.
"Fortunately, there was turn and bounce aplenty. We two spinners bowled in partnership. We will try to get the three wickets tomorrow and force them to bat again and win the game," he added.
Bangladesh's last hope to avoid the follow-on was Shakib Al Hasan on 23. Taijul Islam was with him, the tailender yet to score after facing 10 balls.
With the light insufficient to allow any more than just the one over from fast bowler Shaheen Shah Afridi, Sajid and Nauman bowled relentlessly in a desperate bid to win the rain-hit game.
Rain and bad light have eaten up the majority of the game and just 63.2 overs were possible in the last three days.
Nauman was slightly luckless, ending up without a wicket, but he gave the control that allowed Sajid to rip through the Bangladesh batting line-up.
Sajid dismissed all but skipper Mominul Haque, who was run-out for 1 by a direct hit from Hasan Ali at point.
The Bangladesh batsmen, however, also invited trouble by playing rash shots.
"The wicket was difficult and, here, we understand a defensive mindset won't work,” said Najmul Hosain, who top-scored for the hosts with 30.
"So during batting, our plan was to play our natural game and score runs quickly but, unfortunately, the execution was not good.”
Opener Mahmudul Hasan Joy got a duck on his debut after poking at a flighted delivery to slip, and his opening partner Shadman Islam was baffled by extra bounce.
Mominul was run out, and Bangladesh went to tea at 22-3.
Experienced batsman Mushfiqur Rahim deepened the crisis by playing a slog-sweep to gift his wicket for 5.
Liton Das, who hit 114 and 59 in the first Test, was on six when he charged Sajid, while Mehidy Hasan was bowled for a duck while trying to sweep a delivery that turned sharply.
After a delayed start due to early morning rain and a wet outfield, Pakistan scored briskly in a bid to put pressure on Bangladesh.
Babar Azam and Azhar Ali added only five runs to their partnership before it finished on 123 for the third wicket.
Azhar top-edged a delivery from fast bowler Ebadot Hossain on 56, and Babar quickly followed, leg before on 76 to give fast bowler Khaled Ahmed his maiden test wicket.
Bangladesh was back in the contest, but Fawad Alam and Mohammad Rizwan played with caution to combine for a 107-run unbeaten fifth-wicket stand. Both of them reached half-centuries — Rizwan on 53 and Alam on 50 — when Babar declared the innings.
Taijul Islam led Bangladesh with 2-73.