Mehidy Hasan Miraz claimed five wickets to give Bangladesh a slender lead after Pakistan debutant Azan Awais hit 103 on a rain-hit third day of the first test on Sunday.
Pakistan made 386 all out in response to Bangladesh's first innings total of 413 in Dhaka.
Bangladesh closed the day on 7-0 in their second innings to increase their lead to 34 runs, after bad light ended play with Mahmudul Hasan Joy unbeaten on two and Shadman Islam yet to score.
The left-handed Azan, who resumed on 85, completed his hundred off 153 balls to become the 14th Pakistani and sixth player overall to score a century on debut against Bangladesh.
He became pace bowler Taskin Ahmed's 50th test wicket after captain Najmul Hossain Shanto caught the opener at slip.
"It's a very blessed feeling for me because I know it's my debut match and I performed really well for my country," a visibly moved Azan said.
"When I was going in to bat I was a little nervous, but I performed very well for my team."
Pakistan lost wickets at regular intervals but kept coming back as Abdullah Fazal, another debutant, scored 60, Salman Agha made 58 and Mohammad Rizwan chipped in with 59.
Rizwan and Agha made 119 for the sixth wicket, one of three century partnerships for the visitors, before rain wiped out a large portion of the afternoon session.
The pitch offered more assistance to the spinners when play resumed and Mehidy exploited the conditions to perfection, with Pakistan bowled out in 100.3 overs.
Mehidy, who bowled 38 overs of his off-spin, was rewarded for his patience.
"On a true wicket like this, as a spinner my mindset is that I will not get help from the pitch in the first three days," Miraz said.
"If I bowl in good areas and the batter makes a mistake, then I have a chance of taking wickets. My job was to make sure I did not concede runs from one end."
"In the second innings I will come as an attacking bowler when the ball is turning," he said.
BANGLADESH: Najmul Hossain Shanto (capt), Mahmudul Hasan Joy, Shadman Islam, Mominul Haque, Mushfiqur Rahim, Litton Das (wk), Mehidy Hassan Miraz, Taijul Islam, Taskin Ahmed, Nahid Rana, Ebadot Hossain
PAKISTAN: Azan Awais, Imam-ul-Haq, Abdullah Fazal, Shan Masood (capt), Saud Shakeel, Mohammad Rizwan (wk), Salman Agha, Shaheen Shah Afridi, Noman Ali, Hassan Ali, Muhammad Abbas

