At stumps, Pakistan were 340 for six, 12 runs in front, with Younis ending a run of low scores courtesy of his 101 not out after sharing a fourth-wicket partnership of exactly 150 with Shafiq (109).
This was Younis's 32nd century in 108 Tests.
It was also the 30th successive occasion that Younis had converted a Test innings of 90 plus into a hundred -- one more than Australia's Don Bradman, widely regarded as cricket's greatest batsman.
Earlier, Shafiq put the pain of a pair last time out behind him in style.
Promoted up the order from number six, Shafiq's century came immediately after he twice made nought during England's 141-run win in the third Test at Edgbaston.
"It was really difficult for me previously, because things weren't going my way, my head was falling over," Shafiq told Sky Sports.
"Everything I did wasn't going good."
On Thursday, Pakistan -- whose close catching has let them down throughout the series -- dropped Moeen Ali on nine and then saw him make 108 in a total of 328.
"In tight games like this you have to take every opportunity," said England assistant coach Paul Farbrace. "If we want to be number one we have to take catches."
- Hanif tribute -
=================
Shafiq's innings was played out against the backdrop of flags above The Oval pavilion flying at half-mast in honour of Pakistan legend Hanif Mohammad, who died aged 81 on Thursday.
One of cricket's greatest batsmen, Mohammad had said the equally diminutive Shafiq's technique was as close as anyone had come to his own.
Azhar, promoted to open after his century at Edgbaston, and Yasir Shah were both nought not out.
But having done his nightwatchman duty by getting through the first hour, Shah fell for 26 when he nicked fast bowler Steven Finn to second slip Joe Root.
The blue and sunny skies above The Oval, allied to a good pitch, offered some of the best batting conditions this series.
Shafiq avoided a third straight nought by getting off the mark with a cover-driven four off Finn.
Finn put down a caught and bowled chance from Azhar, then on 35, before the batsman was caught behind on 49 gloving a sweep off Ali.
Younis, who had been hopping about the crease during a series where his previous best score was 33 in Pakistan's win in the first Test at Lord's, looked far more in control on Friday.
His square-cut four off Anderson saw him to an 86-ball fifty in two hours.
Shafiq spent 17 balls on 99 before a quick single took him to a hundred in just over five hours off 164 balls with 12 fours and two sixes.
Unlike previous Pakistan hundreds this season, Shafiq opted against celebrating with a flamboyant press-up routine -- a tribute to the military staff who had helped the squad get fit during a pre-tour boot camp.
Chris Woakes then struck twice in an over with the new ball to remove skipper Misbah-ul-Haq and debutant Iftikhar Ahmed.
Younis, 38, got to his hundred in 139 balls with 15 fours and a six.
The conductor of Pakistan's victory press-up celebrations across London at Lord's, Younis marked his century more modestly by kissing the Oval turf.
Earlier in the tour, Younis had said he would be the "happy man of the earth" if he could play well in a Pakistan series win.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
