Misbah-ul-Haq scored a 72-ball 82 as Pakistan declared in their second innings on 195-6.
In Bangladesh???s second effort of the day with the bat, Imrul Kayes (16) was the only wicket to fall, with Tamim Iqbal (32no) and Monimul Haque (15no) seeing things out till the close.
Earlier the Tigers were dismissed for 203 in their first innings with Shakib Al Hasan left stranded on 89 not out as Wahab Riaz (3-73) took two quick wickets in the morning.
Resuming on 107-5, Bangladesh added only six runs to their overnight total when Soumya Sarkar was snapped up at short cover off Wahab, who then dismissed Shuvagata Hom for a duck in his next over.
Mohammad Hafeez bowled Taijul Islam for 15 to reduce Bangladesh to 140-8 but that brought about an impressive counter-attck from Shakib at the other end
On only 27 at the time, he smashed 62 of the 63 runs he added for the ninth wicket with Mohammad Shahid, who held his end for nine overs.
But the innings finished when Shahid was dismissed by Yasir Shah (3-58), because the injured Shahadat Hossain was unable to bat.
Pakistan chose not to enforce the follow-on but were dealt a blow just before lunch as Hafeez was dismissed for a duck with the fourth ball of the innings, caught behind off Mohammad Shahid (2-23).
Shahid struck again soon after the interval when he removed Sami Aslam for eight, before Azhar Ali ??? double-centurion in the first innings ??? became Sarkar’s first Test victim after making 25.
It brought Misbah to the crease, who was well-supported in his quick-fire knock but Younis Khan (39), before the latter fell soon after tea, caught and bowled by Taijul.
Asad Shafiq (15) was the next to go, bowled by Shuvagata to reduce Pakistan to 140-5. Misbah batted on, putting on 55 with Sarfraz Ahmed (18no) for the sixth wicket, taking their lead well past 500.
When Misbah departed to Mahmudullah, the captain immediately declared to give his team a spell at Bangladesh before the close.
The Tigers weren???t as troubled at the start of their second innings, scoring 63 in their 14 overs, although they did lose Kayes, bowled by Yasir.