England remove Pakistan centurions Shafique and Haq
Off-spinner Will Jacks dismissed Shafique for 114, while left-armer Jack Leach had Haq for 121.
Pakistan still need another 160 runs to avoid follow-on after England finished with 657 Friday, their highest total ever against the home team.
Despite three wickets falling in Saturday's first session, the much-criticised Rawalpindi Stadium pitch offered little to the bowlers.
At the break, skipper Babar Azam was on 28 and Saud Shakeel yet to score.
Azhar Ali was trapped leg-before by Leach on 27, but he could have gone more cheaply had Zak Crawley not dropped a sharp chance to his left at leg slip from pacer James Anderson's first over of the morning.
The centuries by Shafique and Haq meant for the first time in 146 years of Test cricket the openers of both teams reached three figures in the first innings.
Their 225-run opening stand - a Pakistan record against England - is also the first time in Test history that two 200-plus opening partnerships were made, following Crawley and Ben Duckett's 233-run partnership for the visitors.
Pakistan started the day on 181 without loss and Shafique, 89 overnight, was the first to three figures with a sharp single off Joe Root.
Haq, who started the session on 90, followed with a boundary off the same bowler to complete his century.
They both now have three Test centuries and successive hundreds at the venue, having also reached three figures against Australia in March this year.
The three-match series is England's first in Pakistan for 17 years.