Younus Khan closed in on a century after Mohammad Hafeez hit a career-best 143 as Pakistan strengthened their grip on the first Test against Bangladesh on Saturday.
The visitors, resuming on 132-0, reached 415-4 at the close on the second day to build up a lead of 280 runs after bowling out Bangladesh for 135.
The former Pakistan captain became only the fourth Pakistani cricketer to complete 6,000 runs in Tests.
Bangladesh hoped to build up some momentum after left-arm spinner Elias Sunny had Pakistan captain Misbah-ul Haq dismissed for 20 runs in the final session.
However, the unbroken 104-run stand between Younus and Shafiq kept Pakistan firmly in control as they built on the well-composed century of opener Hafeez.
Hafeez, who faced 237 balls and clubbed 14 boundaries, was unlucky to be dismissed lbw, though replays suggested the ball took a thin inside edge and hit him on the backfoot.
Resuming on 74, the right-hander completed his fourth test century and second against Bangladesh with a boundary off Mahmudullah, who gave Bangladesh their first breakthrough in the morning.
The off-spinner trapped overnight batsman Taufiq Umar lbw on 61, ending his 164-run opening stand with Hafeez.
Azhar Ali was the other batsman dismissed, edging paceman Shahadat Hossain to wicketkeeper Mushfiqur Rahim for 26.
Scoreboard
Bangladesh (first innings) 135 all out
Pakistan (first innings) 132-0 overnight
Mohammad Hafeez lbw b Elias Sunny 143
Taufiq Umar lbw b Mahmudullah 61
Azhar Ali c Rahim b Shahadat Hossain 26
Younus Khan not out 96
Misbah-ul-Haq lbw b Elias Sunny 20
Asad Shafiq not out 40
Extras: (b-1 w-1 lb 18, nb-9) 29;
Total: (four wickets; 128 overs) 415;
Fall of wickets: 1-164, 2-220, 3-265, 4-311;
Bowling: Shahadat Hossain 18-3-71-1 (w-1 nb-5), Rubel Hossain 18-1-65-0 (nb-4), Mahmudullah 27-7-83-1, Shakib Al Hasan 29-6-85-0, Elias Sunny 33-5-81-2, Nasir Hossain 1-0-1-0, Mohammad Ashraful 2-0-10-0.
Pakistan take firm grip of opening Test
Spinners help Pakistan whitewash Bangladesh
Seven bowling wonders of 2011
ODI rankings: Ashwin jumps to 18th spot
Pakistan take series despite Hossain century