At tea on the final day, Pakistan were 148 for seven after losing four wickets for just one run in 23 balls.
With all their specialist batsmen now dismissed, the question of scoring the further 195 runs they needed to reach a victory target of 343 was no longer a live issue.
Pakistan's priority now was to try to bat out the day's remaining 28 overs and prevent England going 2-1 up in the series ahead of next week's fourth and final Test at The Oval.
Pakistan were 124 for three when their collapse started, with captain Misbah-ul-Haq (10) caught behind off Steven Finn to give the persevering fast bowler his first wicket of the series.
Also Read
Asad Shafiq then completed a pair when he was plumb lbw to all-rounder Woakes for a four-ball duck.
The paceman then made it two for none in six balls when Sarfraz Ahmed was also out for nought as he edged straight to Joe Root at second slip.
Sami Aslam, playing his first Test of the series, had again batted superbly for 70 following the opener's first-innings 82.
It was the end of a more than three-and-a-half-hour innings, with Aslam facing 167 balls including 11 fours.
Finn had now taken two for none in 11 balls and tea was put back by 15 minutes to see if England could wrap up the game.
But instead they had to content themselves with a session where they took six wickets for 79 runs.
But Moeen Ali, who earlier on Sunday had made a quickfire 86 not out in a total of 445 for six declared, accounted for Azhar on 38 when the off-spinner had him edging to England captain Alastair Cook at second slip.
Jonny Bairstow was 82 not out and Ali 60 not out after they had taken the match away from Pakistan on Saturday.
Birmingham-born Ali, who grew up near Edgbaston, struck 19 runs in the first over of Sunday's play from Yasir Shah, including two successive sixes.
Bairstow had added just one run to his overnight score when he was lbw to Sohail Khan on review.
Ali was 86 not out, off just 96 balls including 10 fours and two sixes when Cook declared just four overs into Sunday's play.