At stumps, the visitors were 179 for 1, trailing by 234 runs with nine wickets still in hand.
Earlier in the day, Bangladesh resumed on 301 for 4 and added another 112 runs before being bowled out in 117.1 overs.
Captain Najmul Hossain Shanto top-scored with a superb 101, while Mominul Haque made 91 and Mushfiqur Rahim contributed a patient 71.
Pakistan pacer Mohammad Abbas starred with the ball, claiming 5 for 92 with a disciplined spell, while Shaheen Shah Afridi picked up three wickets.
Bangladesh also received valuable late runs from Taskin Ahmed, who smashed 28 off just 19 balls.
In reply, Pakistan made a confident start through openers Imam-ul-Haq and Azan Awais, who shared a 106-run opening stand. Imam scored 45 before being trapped lbw by Mehidy Hasan Miraz.
Azan, however, continued to impress and remained unbeaten on 85 from 133 balls, hitting 12 boundaries. He was well supported by Abdullah Fazal, who ended the day unbeaten on 37.
Bangladesh’s pace attack struggled to make regular breakthroughs despite generating pace and movement, leaving the hosts needing early wickets on Day 3 to maintain control of the match.