Moeen Ali made a superb century to lift England to 328 all out after Pakistan had taken four early wickets on the first day of the final Test at The Oval on Thursday.
The touring side reached three for one in reply at the close, leaving the match finely poised with England 2-1 up in the series.
Pakistan reduced the home team to 110 for five before Moeen and Jonny Bairstow shared a sixth-wicket partnership of 93 to drag them back into the match.
Moeen, who reached his century with a six over mid-wicket off leg-spinner Yasir Shah, was last man out for 108. Bairstow made 55 and Chris Woakes 45.
England captain Alastair Cook won the toss and chose to bat in overcast conditions.
Alex Hales, on six, was caught by Shah at mid-wicket off Mohammad Amir while Cook, on 35, bottom-edged a short ball from Sohail Khan on to his stumps.
Joe Root moved fluently to 26 before he nicked a fired-up Wahab Riaz to wicketkeeper Sarfraz Ahmed and the left-armer produced another venomous delivery to account for James Vince (one) in similar fashion.
Gary Ballance became Wahab's third victim after lunch when he was caught by Azhar Ali for eight while Bairstow, on 13, was caught off a no ball.
Pakistan also spilled Moeen twice and he and Bairstow went on the attack, each hitting seven fours as they reached their half-centuries before tea.
Bairstow edged another catch to Sarfraz off Amir after the interval but Woakes continued his excellent form in the series, hitting eight fours in 57 balls to continue the England momentum.
He and Stuart Broad were dismissed in the same over by Sohail but Steven Finn and James Anderson hung around to enable Moeen to reach his third Test hundred.
The England all-rounder had struck two sixes and 13 fours when he skied Sohail to Shah at deep square leg to give the Pakistan fast bowler figures of five for 68.
Pakistan then had three overs to negotiate before the close and Broad trapped young opener Sami Aslam lbw for three, the batsman failing to overturn the umpire's decision on review.
Azhar and nightwatchman Shah were unbeaten on nought at the close.