At the close, England were 253 for seven in reply to Pakistan's first innings 339 -- a deficit of 86 runs, with Chris Woakes 31 not out.
Shah, in his first Test since serving a three-month drugs ban -- and his first outside of Asia and the United Arab Emirates -- ran through England's middle-order on the way to five for 64 in 25 overs.
Earlier, England captain Alastair Cook made 81 and in the process surpassed India great Sunil Gavaskar as the highest run-scoring opening batsman in Test history.
But, in sight of a century, he became Mohammad Amir's first Test wicket in six years when the left-arm quick, who twice had Cook dropped, got him to play on.
Also Read
Amir, was making his return to Test cricket at Lord's -- the scene of his 2010 spot-fixing crime which saw him given a five-year ban and a jail term for deliberately bowling no balls.
It was a similar story when left-hander Cook, now on 55, again edged Amir but wicket-keeper Sarfraz Ahmed floored the seemingly simple two-handed chance.
Amir screamed in frustration before sharing a wry smile with captain Misbah-ul-Haq, who gave the 24-year-old paceman a consoling pat on the back.
After the early loss of opener Alex Hales, Cook and new number three Joe Root shared a stand of 110.
Cook, belying his reputation as a steady run-maker, struck three fours in four balls as Rahat Ali strayed onto the left-hander's pads.
James Vince and the recalled Gary Ballance were both lbw as they each failed to 'pick' Shah.
Cook's cut four off Amir took him to 61 and beyond Gavaskar's mark of 9,607 runs as a Test opener.