Teenage paceman Naseem Shah removed Bangladesh opener Saif Hassan to give Pakistan an early breakthrough after the home team put on a big 212-run lead in the first Test on Sunday.
Fighting to save the Test, Bangladesh were 51-1 at tea on the third day, with opener Tamim Iqbal on a confident 32 and Najmul Hossain Shanto on three.
Bangladesh, who scored 233 in their first innings, still need another 161 to avoid an innings defeat with nine wickets intact.
Pakistan were bowled out for 445 in their first innings with Babar Azam scoring 143 and Haris Sohail 75.
Saif, playing his first Test, was on a pair after his second ball duck in the first innings but he started confidently to reach 16 with four boundaries before he was bowled by Naseem.
Iqbal, fresh from scoring the highest first class score on Bangladeshi soil of 334 not out last week, has so far hit six boundaries.
Earlier, Pakistan lost seven wickets on either side of lunch with Sohail holding the innings.
Sohail, whose position was in danger after consistent failures, hit seven fours and two sixes in his third Test half century before he holed out off spinner Taijul Islam to deep mid-wicket.
Last man Naseem was run out to end Pakistan's first innings.
- Holiday crowd -
A healthy 10,000-strong holiday crowd had come in anticipation of popular batsman Babar Azam scoring a double hundred.
But resuming at 342-3, Pakistan lost Azam to the first ball of the day.
Azam seemed caught in two minds whether to play or leave a length delivery from pace bowler Abu Jayed and edged to Mohammad Mithun at first slip.
Azam's 143 was his fifth Test hundred and a masterclass of attractive batting which lasted 4hr 37min and included a six and 18 fours.
Asad Shafiq, who put on 137 for the fourth wicket with Azam, added just five to his overnight score before he was caught behind off fast bowler Ebadot Hossain for a 65 that included nine boundaries.
Jayed was the pick of the bowlers with 3-86 while Islam finished with 2-139. Wicketkeeper Mohammad Rizwan fell quickly for 10, miscuing a hook off Rubel Hossain which was safely taken by Mahmudullah at fine leg.
Rubel also dismissed Yasir Shah for five and Shaheen Shah Afridi for three -- both leg-before to finish with figures of 3-113.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)