Rampant England pushed its first test in Pakistan in 17 years to an exciting last-day finish after setting a brave target of 343 runs for the home team on Sunday. (More Cricket News)
Pakistan ended the fourth day at 80-2, needing a further 263 runs in a maximum of 90 overs left in the first test of the three-match series.
First innings centurion Imam-ul-Haq was not out on 43 off 60 balls while one of four Pakistan debutants, Saud Shakeel, was lucky to be there on 24 after Keaton Jennings couldn't hold on to a two-handed catch close to the wicket in the penultimate over of the day.
Ben Stokes' plan to start with a barrage of short-pitched balls paid dividends for England in the final session after the tourists declared their second innings at 264-7 at tea for an overall lead of 342.
Abdullah Shafique (6), one of the three Pakistan first innings century-makers, fell into England's trap and pulled to Ollie Robinson in the deep before Azhar Ali was struck on his right index finger in the same over and left the field in pain.
Stokes, who shared the new ball with Robinson, got the faint inside edge of Babar Azam off another short pitch ball to reduce Pakistan to 25-2 before the two left-handers — Imam and Shakeel — batted confidently to produce a 55-run stand until Jennings' missed opportunity.
In its first innings, Pakistan's lower order dug in to reduce England's lead before getting dismissed for 579.
But England didn't sit back on a wicket still conducive to batting and pushed its bid for victory with yet another electrifying display with the bat from the top order in the second session.
Joe Root smashed 73 and Harry Brook followed his belligerent century in the first innings with 87 off 65 balls before getting bowled by fast bowler Naseem Shah (2-66).
England added a brisk 218 runs in the second session to finish the innings with a rapid run rate of 7.4 an over, which matched its first-innings aggression that saw the visitors rack up an electrifying total of 657.
Despite losing first-innings century-makers Ben Duckett and Ollie Pope, England underlined its plan of setting up a target for Pakistan in reaching 46-2 in seven overs before lunch.
Pakistan's inexperienced bowling resources were further reduced when debutant fast bowler Haris Rauf couldn't recover from his strained right quad and was unable to bowl in the second innings.
Root survived a scare shortly after completing his half-century when Naseem couldn't hold on to a reverse sweep in the covers before leg spinner Zahid Mahmood (2-84) dismissed him and then Stokes for a duck in a single over.
Earlier, off-spinner Will Jacks, who was given his test debut at the last minute after Ben Foakes had to sit out due to a viral infection, picked up 6-161 on a wicket doing the bowlers few favors before Pakistan was eventually bowled out.
Pakistan's tailenders frustrated England for nearly 1.5 hours with Agha Salman scoring 53 off 67 balls after the home team resumed on 499-7.
Salman shared a 57-run stand with Mahmood (17), who didn't play a false shot despite being surrounded by at least six England fielders close to the bat for much of his time at the crease.
Salman successfully overturned on-field umpire Joe Wilson's leg before decision through a television referral just before reaching his half-century.
TV replays suggested Jacks had pitched the ball outside the line of leg stump when the batter attempted a reverse sweep, but missed the line of the ball and was struck on the front pad.
Salman reached his second test half-century by chipping left-arm spinner Jack Leach over covers before edging Jacks to the lone slip. Leach bowled the bulk of the overs with Jacks and finished with 2-190.
Injured Rauf (12) hung in with Mahmood and added a further 22 runs before Jacks finally wrapped up the innings by dismissing both batters.