Shakib Al Hasan became the first Bangladeshi to hit a century and take five wickets in an innings in the same Test but his efforts look like being in a losing cause after Pakistan seized control of the second Test.
All-rounder Shakib followed his first-innings 144 with the bat by snapping up six for 82 with the ball as the hosts bowled out Pakistan, already 1-0 up in the two-match series, for 470 on the fourth day on Tuesday.
However, pacemen Umar Gul and Aizaz Cheema then claimed two wickets apiece as Bangladesh limped to 114 for five in their second innings, trailing the visitors by 18 runs overall.
Nasir Hossain (30) and Mushfiqur Rahim (seven) were still at the crease when bad light ended play for the day.
Pakistan captain Misbah-ul-Haq scored his 14th Test half-century before he became Shakib's first victim of the day, caught at slip by Mahmudullah for 70.
Asad Shafiq was next to go, leg before for 42 after being deceived by a swinging ball from Robiul Islam.
Shakib then had Abdur Rehman (24) caught by Mahmudullah before Gul (11) top-edged a delivery from the slow left-armer to Elias Sunny at mid-on.
Saeed Ajmal [ Images ] went for a duck three balls later, bowled by Shakib, and Adnan Akmal was stumped by Mushfiqur for 53 in the spinner's next over.
Bangladesh's joy at taking all 10 Pakistan wickets vanished quickly when Gul struck twice in two balls before tea to reduce the home side to 24 for two.
Gul had Tamim Iqbal caught by Misbah at first slip for 21 although video replays suggested the ball might have hit the opener on his helmet.
The paceman then trapped Shahriar Nafees leg before for a duck.
Rehman bowled Nazimuddin for 12 before Cheema dismissed Mahmudullah (32) and Shakib (six).
Bangladesh (1st innings): 338 (Shakib Al Hasan 144, Shahriar Nafees 97)
Pakistan (1st innings): (overnight 292-3)
Mohammad Hafeez [ Images ] c Rahim b Nazmul Hossain 14
Taufiq Umar c Nafees b Nazmul Hossain 130
Azhar Ali c Rahim b Shakib Al Hasan 57
Younus Khan c Rahim b Elias Sunny 49
Misbah-ul-Haq c Mahmudullah b Shakib Al Hasan 70
Asad Shafiq lbw b Robiul Islam 42
Adnan Akmal st Rahim b Shakib Al Hasan 53
Abdur Rehman c Mahmudullah b Shakib Al Hasan 24
Umar Gul c Sunny b Shakib Al Hasan 11
Saeed Ajmal b Shakib Al Hasan 0
Aizaz Cheema not out 1.
Extras: (lb-3, nb-16) 19
Total: (all out; 154.5 overs) 470
Fall of wickets: 1-23, 2-150, 3-245, 4-293, 5-359, 6-389, 7-430, 8-464, 9-465.
Bowling: Shahadat Hossain 16-1-82-0 (nb-6), Robiul Islam 23-3-78-1 (nb-6), Nazmul Hossain 24-5-61-2 , Mahmudullah 15-2-45-0, Shakib Al Hasan 40.5-7-82-6, Elias Sunny 27-4-95-1, Nasir Hossain 9-0-24-0.
Bangladesh (2nd innings):
Tamim Iqbal c Misbah b Umar Gul 21
Nazimuddin b Abdur Rehman 12
Shahriar Nafees lbw b Umar Gul 0
Mahmudullah c Rehman b Aizaz Cheema 32
Nasir Hossain not out 30
Shakib Al Hasan c Azhar b Aizaz Cheema 6
Mushfiqur Rahim not out 7.
Extras: (b-5, lb-1) 6
Total: (for five wickets; 35 overs) 114
Fall of wickets: 1-24, 2-24, 3-54, 4-76, 5-95.
To bat: Nazmul Hossain, Elias Sunny, Shahadat Hossain, Robiul Islam
Bowling: Umar Gul 7-1-23-2, Aizaz Cheema 10-1-41-2, Abdur Rehman 13-5-25-1, Saeed Ajmal 5-1-19-0.