Leg-spinner Shah took 10 for 141, including a second-innings haul of four for 69 on Sunday's fourth day.
His return, which surpassed Waqar Younis's previous Test-match best for Pakistan at Lord's of eight for 154, was central to the tourists going 1-0 up in this four-match series.
Mohammad Amir in his first Test appearance since he was given a five-year ban for his part in the 2010 spot-fixing scandal at Lord's -- Pakistan's last Test at 'the home of cricket' -- ended the match when he bowled last man Jake Ball.
They were holding firm at 195 for six thanks to a determined stand of 56 between Jonny Bairstow (48) and Chris Woakes (23). But Bairstow's three-and-a-half hour innings ended when he was bowled trying to whip a Shah leg-break.
More From This Section
England were soon 196 for eight when left-arm quick Amir bowled Stuart Broad. Shah then had Woakes, who took 11 wickets in the match, caught at slip before Amir ended the contest.
His back-off-a-length ball had England captain Alastair Cook (eight) edging through to wicket-keeper Sarfraz Ahmed.
Cook's opening partner Alex Hales (16) then carelessly chased a wide Rahat ball outside off stump, with Mohammad Hafeez holding a good catch at first slip. Joe Root struck two superb cover-driven fours off Rahat but the star batsman fell into a hooking trap on nine when he paddled a Rahat short ball to Shah, set back at deep square leg.