England fought back late on the second day of the first Natwest Test match at Lord's but still find themselves 166 runs behind behind at the close of play.
Having bowled England out for 184 on day one, Pakistan began the second day on 50-1 and Azhar Ali and Haris Sohail both looked in good touch in the first hour.
James Anderson struggled to find the right length and was removed from the attack only three overs into his first spell while Stuart Broad, though markedly better, was equally unable to find the breakthrough.
Mark Wood gave England a much-needed boost when catching Sohail on the crease and having him well held behind the wicket by Jonny Bairstow.
It was just reward for the Durham paceman who bowled with hostility throughout the day and might have finished with a couple more wickets but for some average catching from the home side.
Asad Shafiq looked to be positive from the outset and despite losing Ali - the opener pinned in front by the returning Anderson for 50 - he continued to attack and launched Dom Bess into the midwicket stands just before the players left the field for lunch.
Upon resumption, he and Babar Azam quickly turned the screw, the former going past 50 with an uppercut over the slips for four while the latter looked particularly strong off the back foot through the off side.
The pair added 84 until Stokes got rid of Shafiq with a snorting bouncer that he could only fend to the slips.
When Pakistan captain Sarfraz Ahmed hooked Stokes into the grateful hands of Wood at fine leg on the stroke of tea, England still had realistic hopes of restricting the visitors' lead, and they were boosted further when Azam was forced to retire hurt not long after play had resumed.
Having moved serenely onto 68, Azam ducked into yet another short ball from Stokes with his left forearm taking the brunt of the blow. Azam was immediately in some pain and despite willing himself to continue, left the field with England sensing an opening.
However, Shadab Khan and Faheem Ashraf played aggressively to put on 72, Shadab bringing up another half-century for Pakistan until Stokes had him caught behind for 52.
It was Anderson who had broken the stand, though, brushing off the disappointment of having Shadab dropped by Alastair Cook to bowl Ashraf via an inside edge.
Despite starting the day poorly, Anderson finished strongly and dismissed Hasan Ali before the close of play to finish the day with figures of 26-6-82-3.
Stokes claimed 3-73 from his 22 overs to keep England just about in touch, but with the lead already at 166, Joe Root's side have a mountain to climb if they are to bat themselves back into the game.