Pakistan made a strong reply and reached 145 for no loss after fast bowler Hasan Ali claimed 5-51 to dismiss Bangladesh for 330 on day two of the opening test on Saturday.
Openers Abid Ali and debutant Abdullah Shafique played out the second and third sessions comfortably in a good batting track to cut the deficit to 185 runs.
Abid, who reached the 1,000-run mark in his 15th test, closed in on his fourth century, remaining unbeaten on 93 at stumps, owing to bad light. Shafique overcame a nervy start to finish the day on 52 not out.
"We are in good position now and will try to take it session by session," Abid said. "Our first target is to go past Bangladesh's 330 and then we will try to take a big lead to give our bowlers an advantage."
Abid struck the first three boundaries when Shafique struggled to get off the mark.
Shafique flicked through mid-wicket for four off pacer Abu Jayed and grew with confidence. Abid was fluent in his approach and glanced off-spinner Mehidy Hasan for a couple to reach his third half-century off 84 balls.
Shafique brought up his half-century in style, clubbing occasional bowler Mominul Haque for the maximum.
Bangladesh's hope of racking up a substantial total was dashed by fast bowler Hasan earlier. Hasan broke Bangladesh's resistance in the first session as the home side resumed on 253-4.
He alone took four wickets on day two with Bangladesh adding just 77 runs for the rest of the six wickets.
Hasan's sixth five-for was well-complemented by his new ball partner Shaheen Shah Afridi who returned figures of 2-70 and medium pacer Faheem Ashraf, 2-54.
For Bangladesh, Liton Das top-scored with 114 after hitting his maiden century and Mushfiqur Rahim added 91. Mehidy was not out on 38.
Das, starting the day with 113, added just one run before Hasan had him leg-before, which the umpire disagreed, only for the decision be overturned on review.
Debutant Yasir Ali spent some nervy moments in the crease and survived a leg-before review by Pakistan. However, he got off the mark in international cricket with a cover-drive four off Afridi on the 14th ball he faced. But Hasan tested him with short balls and finally rattled him stump with a delivery that jagged in sharply.
Bangladesh relied on overnight unbeaten Rahim to take the side to safety and he grew with confidence, hitting Afridi for a boundary through backward point. Medium pacer Ashraf moved the ball nicely to coax an edge from him but fell nine runs short of his eighth century.
After losing three wickets for just 23 runs, the much-needed resistance came from Mehedi who guided lower order amid the well directed short ball barrage of Afridi and Hasan.
Hasan then cleaned up the tail to bring an end to the innings.
Brief Scores: Bangladesh 330 all out (Liton Das 114, Mushfiqur Rahim 91; Hasan Ali 5/51) lead Pakistan 145/0 (Abid Ali 93*, Abdullah Shafique 52*) by 185 runs