England gave Pakistan an almighty scare before bad light ensured the first Test in Abu Dhabi ended in a draw.
Adil Rashid took 5-64 on debut as Pakistan crumbled to 173 all out in their second innings, but set 99 to win England ran out of time on 74 for four as darkness descended in the desert
Rashid's five-wicket haul was the first by an English leg-spinner in Test cricket since 1959, and completed a remarkable turnaround after he returned 0-163 in the first innings.
A draw had looked all but certain as both teams amassed in excess of 500 in their first innings, but 15 wickets fell on an enthralling final day after only 16 had been taken over the first four as the tension mounted in the closing stages.
Indeed, England's first innings did not come to a close until the final morning, with Alastair Cook - whose marathon 263 came to an end yesterday evening - finally calling in his troops on 598 for nine.
That gave the tourists an unlikely lead of 75, and
James Anderson struck twice with the new ball to leave Pakistan reeling on three for two.
Shan Masood was bowled cheaply via a deflection for the second time in the game - this time jamming the ball down off the toe of the bat only to see it spin back into his stumps - for one.
Shoaib Malik had made 245 in his first innings, but fell for a duck as England's leading Test wicket-taker tied him up with a short ball which was tamely fended to Jonny Bairstow at short-leg.
Mohammad Hafeez was brilliantly run out by a Ben Stokes direct-hit after lunch, but veterans Younus Khan and Misbah-ul-Haq then looked to have made the game safe with a fourth-wicket stance of 66.
The introduction of spin after tea turned the game on its head once more, as Rashid lulled Younus - five short of his half-century - into miscuing a slog to Stokes at cover for a first Test scalp.
Asad Shafiq was caught behind having nicked a leg-spinner that turned off a good length, and Moeen Ali got in on the act as a rush of blood saw Misbah charge down the track only to be bowled through the gate on 51.
Moeen had Wahab Riaz well caught by Bairstow at short-leg, but the fielding reached new heights when Anderson took a one-handed stunner at slip off Rashid to end Zulfiqar Babar's knock.
Rashid and Anderson combined again to take the last two wickets in as many balls - both Sarfraz Ahmed and Imran Khan beaten by turn.
England promoted Jos Buttler to open alongside Moeen in place of Cook, but the wicketkeeper was first to fall when he went lbw to Malik for four.
Pakistan opened with spin from both ends, and Babar picked up the wicket of Moeen for 11 when he holed out to Malik at deep midwicket.
Ben Stokes fell in similar fashion attempting to slog Malik, but Joe Root and Bairstow added 31 in 21 balls to give England hope.
But Bairstow, who had smashed Wahab for six over midwicket, was stumped charging Babar.
Root and Ian Bell then struggled to pierce the outfield, and with 11 overs gone umpires Paul Reiffel and Bruce Oxenford decided the light had deteriorated too much for play to continue.
England captain Alastair Cook, whose record-breaking 263 in the first innings was ultimately in vain, admitted England were frustrated to come so close to victory.
We'd have liked another three or four overs at the end but that's the way it goes, he said. I can't fault the guys for hanging in there on that wicket.
The pitch did deteriorate and spun more today which gave us hope, so it's a bit of a bittersweet finish. We knew we had to put the pressure on Pakistan and then on the last day you never know.
We played a good game and so did Pakistan. They were a bit sloppy today and we put them under pressure.
It was brilliant from Adil Rashid who I think got some unfair criticism after the first innings. He's a very fine bowler.