Pakistan's Saud Shakeel and Imam-ul-Haq hit fighting half-centuries on Sunday to foil England's seam and pace attack and set up an exciting finish to the second Test in Multan.
Set a challenging 355 runs for victory, Pakistan ended the third day at 198-4, needing another 157 with two full days remaining.
With reverse swing helping the fast bowlers, England derailed Pakistan's start of 66 without loss with three wickets for just 17 runs.
But Haq (60) and Shakeel (54 not out) led a remarkable 156-minute fightback during their stand of 108 for the fourth wicket before Jack Leach had the former caught at slip three overs before stumps.
Haq, who came in at number five instead of opening the innings following hamstring treatment, hit seven boundaries.
Allrounder Faheem Ashraf, promoted to number six, was three not out as Pakistan chased a series-levelling win after losing the first of three Tests by 74 runs in Rawalpindi.
England assistant coach Marcus Trescothick said he thought Haq's wicket shifted the balance in his team's favour.
"I think it was a really important wicket because with the partnership they put together they were building to a nice place," he said.
"Hopefully we put ourselves in a position to win the game."
Still, Pakistan batting coach Mohammad Yousuf saw the balance at 50-50.
"Players are confident that they can win this match," he said.
Pakistan can take heart from the fact that their highest successful chase was 377 against Sri Lanka in Pallekele in 2015, and they beat the same opponents after being set 342 in Galle in July.
No team has ever successfully chased more than 314 in Pakistan, a target reached by the home team against Australia in Karachi in 1994.
After Pakistan's solid start, veteran pacer James Anderson bowled Mohammad Rizwan with the fifth ball after lunch for 30, before Ollie Robinson dismissed skipper Babar Azam for one.
Azam was left shell-shocked as he tried to leave a ball which came in sharply to hit the stumps.
It became 83-3 when Mark Wood bowled Abdullah Shafique for 45 with a ball that reverse-swung to hit the stump and beat a forward push.
Earlier, spinner Abrar Ahmed took 11 wickets for 234 across the two innings -- the second best by a bowler on debut for Pakistan, behind Mohammad Zahid's 11-130 against New Zealand in Rawalpindi 26 years ago.
Harry Brook top-scored with 108 in England's 275 all out.
He smashed spinner Mohammad Nawaz for his 14th boundary to complete his second century of the series, having notched 153 runs in the first Test.
He also struck a six before being caught off spinner Zahid Mahmood, who took 3-52.
England resumed at 202-5 and added 73 runs before folding an hour before lunch.
Ben Stokes made 41 and added 101 for the sixth wicket with Brook before England lost their last five wickets for just 19 runs.
Ahmed's second innings figures were 4-120.
The final Test is in Karachi from December 17.