Opener Mahmudul Hasan hit 52 on Sunday to help Bangladesh reach 3-110, extending their overall lead to 156 at stumps.
Earlier, fast bowler Nahid Rana and left-arm spinner Taijul Islam had claimed three wickets apiece to wrap up Pakistan's first innings for 232, giving Bangladesh a 46-run lead in bowling-friendly conditions.
Bangladesh were bowled out for 278 in their first innings after a sublime 126 from Litton Das on the opening day.
Nahid, fresh from his five-wicket haul in Bangladesh's 104-run victory in the first test, was instrumental in denying Pakistan a first-innings lead.
He dismissed star batter Babar Azam, who made a team-best 68 on his return, before breaking the resistance of Sajid Khan (38) to wrap up the Pakistan innings.
Fast bowler Taskin Ahmed and offspinner Mehidy Hasan shared four wickets to leave Pakistan in trouble after the visitors resumed Sunday at 0-21.
Taskin (2-37) dismissed openers Abdullah Fazal and Azan Awais in his first two overs of the day to put Bangladesh on the front foot.
Abdullah Fazal, fresh from his twin half-centuries in the first Test, edged a delivery behind after scoring nine.
Taskin then swung one viciously past Awais, a centurion in the first Test, who pushed the delivery to short-leg when on 13.
Captain Shan Masood and Babar temporarily stalled the slide before Mehidy (2-21) ended the 38-run partnership when Masood hit a short ball straight to the fielder at short cover for 21.
Mehidy then also dismissed Saud Shakeel (eight) to leave Babar with significant work to do to keep Pakistan in the match.
Babar hit pacer Shoriful Islam for a boundary to raise his 31st fifty off 63 balls and looked to be in control until Nahid produced a beauty to unsettle him.
Babar, who struck 10 boundaries in his 84-ball-knock, chipped straight to Mushfiqur Rahim after being baffled by the clever variation of pace from Nahid, ending the 63-run partnership with Agha.