Pakistan 378 (Misbah 102, Shafiq 83, Younis 58, Masood 54, Wood 3-39, Moeen 3-108) and 354 for 6 dec (Younis 118, Misbah 87, Shafiq 79) beat England 242 (Root 88, Wahab 4-66, Yasir 4-93) and 312 (Root 71, Rashid 61, Yasir 4-87) by 178 runs
Scorecard and ball-by-ball details
Nobody expected it to be cut this fine. England produced one of the finest stonewalling efforts in their history only to concede the second Test in Dubai to Pakistan with only 6.3 overs remaining on the final day. Six wickets down at lunch, eight well before tea, they were indebted to more than four hours of defiance by Adil Rashid before he became the last wicket to fall.
Rashid's maiden fifty in his second Test was a redoubtable effort as Pakistan's spinners tired on a surface that gradually lost its zip as the day progressed but, when least expected, Yasir Shah's legspin finally drew him into a drive through a curtain of close fielders and Zulfiqar Babar scooped up a catch at short cover. The tension was unclamped in an instant as Pakistan completed a victory by 178 runs to go 1-0 up with one to play.
It was an appropriate finale as Pakistan's two spin bowlers combined for the final wicket. They sent down 88.3 overs between them, sharing a return of 7 for 140 on a slow pitch that gave them plentiful encouragement, but no largesse. Pakistan have never bowled so many overs in the fourth innings of a Test, as both slow bowlers will be able to testify when they wake up with aching limbs in the morning.
Twice, it looked as if England's defeat would be a formality, firstly when Joe Root fell in the first hour of play and again, merely a confirmation of their plight, when Stuart Broad, silenced by a superb yorker from Wahab Riaz, became the eighth wicket to fall with 41 overs still left to bowl, the day barely past its mid-point.
Should Pakistan go on to win the series 2-0, they would go second in the ICC Test rankings, quite an achievement for a side unable to play Tests in their own country because of an unstable political situation. Their presence in World T20 is threatened by Indian extremists and, as if all that was not enough, even as the presentation ceremony took place their priority was to discover more news about an earthquake of 7.5 magnitude, centred upon Afghanistan, which had shaken Pakistan's major cities.
For England, the history of the past 10 years had told that survival was not statistically impossible. To bat out the final day would have stood alongside the most outstanding resistance efforts of the past decade: 148 overs by South Africa against Australia in Adelaide in 2012, a backs-to-the-wall innings led by Faf du Plessis, or England's own 143 overs against New Zealand in Auckland a few months later when Matt Prior's defiant hundred did the job. Ultimately, they managed 137.3.
England did not seem equipped for survival. Their lower-middle order was replete with shot-makers, untutored in the sort of turning conditions they had to confront on the final day. The spin and - initially at least - bounce that had been so reluctant to show itself on the fourth evening was available in abundance.
From the moment that Root departed, it felt like a matter of time, but nobody had reckoned for Rashid, who read his fellow spinners as if the holder of an exclusive code, leaving the ball impeccably and shifting the emphasis as the day wore on from wristy strokeplay to steely defence. He was dropped once, off Yasir on 42, when Mohammad Hafeez failed to hold a chance at gully shortly before tea.
England, beginning the last day on 130 for 3, their victory target of 491 irrelevant, added only 57 runs in the morning session as the pressure from Pakistan's spinners was unrelenting. For 50 minutes, the Yorkshire pair of Root and Jonny Bairstow defended stoutly, Root relaxing into the day, Bairstow holding himself stiffly as he stole the occasional run, not just his mind locked in concentration but his neck and shoulders too.
Then Zulfiqar dislodged Root and the anticipation in Pakistan's ranks immediately soared. He had already spun one past the outside edge; the second time he deceived Root, the edge came and Younis Khan pouched a good low catch at slip.
Bairstow followed five overs later. Yasir has bowled only the occasional googly in this Test, but when he gave it an airing, a full-length delivery deceived Bairstow in the air and he was bowled through the gate as he was suckered into a leg-side flick.
For Jos Buttler, there was another failure, one that could interrupt his Test career in Sharjah as England seek to regroup. At least he fell to an excellent delivery as Yasir made one turn and bounce from a challenging length and Younis stooped for his fourth slip catch of the innings, his offerings so plentiful that he might have been picking strawberries in the desert air.
Ben Stokes' torrid time against the turning ball was compulsive, behind-the-sofa viewing, a draining learning experience as he suppressed his attacking instincts and tried to come to terms with what for him were alien conditions.
Sky TV commentators, able to hear the stump mic, let slip that Pakistan's close fielders were chattering happily about the "Angry Man", and the Angry Man was under severe pressure. His first ball, from Yasir, flew safely into the leg side off an inside edge, catches claimed by the keeper or leg slip proved to have come off the pad. Asad Shafiq narrowly failed to rescue a short leg catch when Stokes had only a single to his name.
Twice, he might also have been stumped off Zulfiqar, not that the wicketkeeper, Sarfraz Ahmed was culpable, especially on the second occasion when the ball grubbed past Stokes' outside edge and thudded into his bootlaces. But it was the second new ball that removed him three overs into the afternoon, a short and wide delivery from Imran Khan, which he imagined might bring brief respite but which instead he edged to second slip.
Broad then teamed up with Rashid in an eighth-wicket stand of 60 in 15 overs, surviving a peppering from Wahab before the left-arm quick, straining every sinew, unearthed him with an excellent yorker.
Two Pakistan reviews went unanswered by tea, both off Zulfiqar, as Pakistan hunted unavailingly for an inside edge, Rashid, on 4, and Wood, 16, standing firm as a cluster of close fielders sent shrill appeals into a cloudless sky.
Wood clambered into Wahab, taking three fours off four balls before tea, but then became strokeless, spending what seemed to be half his life on 26. When does a batting side in such a predicament really believe it can hold out? Twenty, 25 overs maybe? Or, in the case of Dubai, that brief period when the pitch is bisected by sun and shade, an unmissable first indication that the day will soon be drawing to a close.
When Zulfiqar made one turn and bounce to have Wood caught by Hafeez at slip, 11.2 overs remained and out walked England's last man, James Anderson. Optimists spoke of Cardiff, when he held out against Australia; pessimists recalled Headingley when Sri Lanka prised him out in the last over and he was reduced to tears.
With eight overs remaining, Anderson, on 0, was dropped by Shafiq, one of two short legs, off Zulfiqar. Was the luck with England? But Yasir, the man who had said after Abu Dhabi that he could make the difference, struck home, so ending an excellent display. Not quite proven as a world-beater perhaps, on this evidence, but with the final act, and match figures of 8 for 190, he had every reason to feel like one.
David Hopps is a general editor at ESPNcricinfo @davidkhopps