Younis Khan and Azhar Ali hit centuries as Pakistan capitalised on Bangladesh's misfortune to post a commanding 323 for three on the opening day of the second and final Test on Wednesday.
Younis made 148 and Azhar was unbeaten on 127, the pair having shared a third-wicket stand of 250 to rescue the tourists from 58-2 after Bangladesh captain Mushfiqur Rahim won the toss and elected to field in Dhaka.
Both batsmen were lucky to reach three figures after being reprieved by no-balls even as Bangladesh struggled to overcome the loss of strike bowler Shahadat Hossain in the day's first over.
Shahadat, who replaced the injured Rubel Hossain for the decisive Test, collapsed on his follow through after sending down the first ball and hobbled off the field after his second delivery.
Shahadat returned after the morning drinks break, and even though he did not bowl for the rest of the session, he took a catch in the deep to dismiss Sami Aslam.
However, Shahadat succumbed to injury again while training during the lunch break and had to be lifted away on a stretcher.
Chief selector Faruque Ahmed said the 28-year-old seamer had injured his right knee and was unlikely to take any further part in the match.
Left with a depleted attack, Bangladesh used nine bowlers to try to contain the run flow, with Rahim and Tamim Iqbal the only ones who did not turn their arms over.
Part-time seamer Soumya Sarkar would have dismissed Younis on 78, caught in the covers from a mistimed drive, but TV replays showed the bowler had overstepped to concede a no-ball.
Similarly, Azhar escaped on 18 when he was caught in the slips off Mohammad Shahid, only to see TV umpire Ranmore Martinesz confirm a no-ball.
Azhar's dismissal at the stage would have reduced Pakistan to 38-2 after Bangladesh had removed both openers cheaply.
Mohammad Hafeez, who hit a double-century in the drawn first Test in Khulna, was caught behind off Shahid for eight.
Left-arm spinner Taijul Islam had Sami Aslam caught by Shahadat on the mid-wicket boundary for 19, but Younis and Azhar settled in to tame the depleted attack.
"I love to score for my team," said Younis, the 37-year-old veteran of 98 Tests, who hit 11 boundaries and three sixes in his 29th Test century.
"When the team is under pressure and needs me, it feels nice to get a century because it is good both for me and the team.
"Partnerships are always the key. Azhar and I got together and had a big one today. But we need to keep up the good work tomorrow also," he said.
Azhar, who reached his eighth hundred by lofting Taijul for his 10th four, added three more boundaries before stumps.
Younis was dismissed by the hard-working Shahid five overs before stumps when he slashed a short ball to gully, where Shuvagata Hom made no mistake.
Captain Misbah-ul Haq was unbeaten on nine at stumps with Pakistan well-placed to build a huge total and put the hosts under pressure.
Shahid, who took two of the three wickets, rued the injury to team-mate Shahadat, saying the outcome may have been different if he had been bowling at the other end.
"This is definitely a pace bowler's wicket," he said. "There was grass on the pitch, there was movement and we were getting a lot out of it.
"I wish Shahadat was around to bowl. Hopefully things will work out better for us tomorrow (Thursday)."