Mohammad Hafeez, Saeed Ajmal, Abdur Rehman and Aizaz Cheema each grabbed a wicket as Bangladesh were left struggling at 134-4 in the second innings at the close on day three having conceded a 459-run first-innings lead.
Debutant opener Nazimuddin and ex-captain Shakib Al Hasan were both batting on 41 when the bails were taken off.
Pakistan captain Misbah-ul Haq declared on 594 for five wickets immediately after Younus converted his 19th test century into his third double hundred with two runs from a Shakib delivery.
Younus, 200 not out, struck 18 fours and three sixes in his 290-ball knock.
Unbeaten on 96 overnight, the right-handed batsman completed his century off the third ball of the morning, flicking a boundary off Shahadat Hossain.
“In my mind this morning I was planning for the first four runs,” Younus told a news conference.
“I was just lucky to have it maybe in the second or third ball. And then suddenly we have changed the plan with the captain and the coach telling me that you must go for your two hundred.
“I dedicate this ton to my family. I want to contribute something for my family and country, especially when my country needs me,” Younus added.
Younus was caught by Elias Sunny off Rubel Hossain on 138 only for the umpire to rule it as a no-ball.
Shafiq (104), dropped by Rubel Hossain off Shahadat when on 43, also made the most of his reprieve to score his maiden test century.
Shahriar Nafees took the catch at long-off off Sunny to end his patient knock off 235 balls featuring nine fours and two sixes.
Bangladesh lost a wicket on the fifth ball into the third session when Tamim Iqbal misjudged a Mohammad Hafeez delivery and was bowled for 15.
Shahriar Nafees was dropped by Younus off Umar Gul at slip, but he was unable to cash in on when he was trapped lbw by Saeed Ajmal for 28.
Mohammad Ashraful completed his nightmarish comeback into the test side, following his single in the first innings with a duck when he was caught by Hafeez off Rehman.
Nasir Hossain, promoted up in the order, was unable to replicate his recent form and mistimed a pull shot off Cheema to be caught by Hafeez for three.