Chris Woakes stood tall at the close as he and Jos Buttler shared in a magnificent chase that saw England provided a classic first Test against Pakistan with a worthy finale.
England were on the rocks when the pair came together on the fourth afternoon, 117 for five on an Emirates Old Trafford pitch that was starting to play tricks and with their target of 277 a dim and distant prospect.
But the pair reclaimed the upper hand in style, putting on 139 in a brilliantly judged sixth-wicket stand that set up a memorable three-wicket victory.
Woakes has been in sensational form with the ball all summer but his remarkable 84 not out, including 10 fours and the deciding runs, saw him turn match-winner with his highest score in more than two years.
Buttler owed a debt to his team after three costly misses behind the stumps in the first innings and paid with a flourish, making a superb counter-attacking 75 that made good on the selectors' ongoing faith.
Only once before has a higher fourth-innings score won a Test in Manchester, Michael Vaughan's side against New Zealand in 2008, and this now sits alongside last year's 'miracle of Headingley' as an unlikely fightback for the ages.
It may not had the Ashes kudos, the nail-bitingly tense finish or the all-important crowd but as an example of cool batsmanship against a pedigree attack, it bears comparison.
🏴 ENGLAND WIN! 🏴
— Sky Sports Cricket (@SkyCricket) August 8, 2020
What a victory as they chase down 2️⃣7️⃣7️⃣ to beat Pakistan by 3️⃣ wickets.
Woakes finishes unbeaten on 84.
England 1-0 up in three-match #ENGvPAK series🏏
📺 Reaction 👉 https://t.co/E1EJj1BlBB
📱 Blog 👉 https://t.co/Wv40o6As2L pic.twitter.com/z3QFcOsLMY
The day began at full throttle with Pakistan's innings wrapped up for 169 in a 16-ball blur that contained 32 runs and two wickets.
Time was no concern when the final innings began, with the best part of six sessions left in the game and with memories still fresh of top-order collapse on day two - 12 for three inside six overs.
A lunch score of 55 for one represented solid progress, Rory Burns the man to go to a fractional lbw decision in Mohammad Abbas' favour, with Dom Sibley going about his business methodically and Joe Root carefully negotiating a much-anticipated first spell from Yasir.
The steady accumulation continued in the afternoon until Sibley broke ranks, swinging hard when Yasir tossed one up to the stumps and squirting to slip. After 114 balls and 36 tough runs it was a soft end.
Having broken the stand at 64, Pakistan went on the charge as England's middle-order engine room crumbled in taxing conditions. Root gave it away on 42, shaping to steer Naseem Shah to his favourite outlet at third man but fending a rising delivery to Babar Azam.
Ben Stokes found himself in an all-too familiar position but was unable to answer the call this time. It took lavish, unnatural bounce from Yasir to beat him on nine, with a light brush of the glove on the way through to Mohammad Rizwan.
The writing appeared to be on the wall when Shaheen Afridi got one to explode off the pitch at Ollie Pope, leaving him no option but to flinch in shock and loop a catch to gully. With four wickets tumbling for 31 runs, the winning line now seemed distant and the pitch wholly unreliable.
England's recent first Test results:
— Sporting Life (@SportingLife) August 8, 2020
❌ Lost to West Indies
❌ Lost to Australia
❌ Lost to New Zealand
❌ Lost to South Africa
❌ Lost to West Indies
Now we can add this:
☑️ Beat Pakistan
What. A. Run. Chase.
🏏🏃♂️👏 @englandcricket pic.twitter.com/XWBQGRf59w
In those circumstances, what Buttler and Woakes produced was incredible. The pair put on exactly 50 in jut 49 balls before tea, egging each other on with a series of increasingly dazzling shots.
Buttler went after Yasir with a pair of classic drives and glorious sweeps on either side of the wicket, while Woakes took the game to Shaheen with four lavish strokes in the arc between cover and point.
The speed of the reversal was dizzying, barely leaving Pakistan time to realise how much damage had been inflicted. The tea break might have broken the spell but a serene on-drive and a deft late cut from Woakes suggested otherwise as the target came down to double figures.
Both men reached half-centuries in the 63rd over, Butter marginally quicker in 55 balls but Woakes in real style as he punched Naseem for back-to-back fours through cover.
Pakistan slowed the rate by pushing out the field but the batsmen shifted accordingly, ticking off the century stand in little more than 20 overs then dragging the required runs under 50.
In desperation Pakistan burned their last two reviews in the space of eight balls before a slog-swept six from Buttler brought the line ever closer.
Yasir guaranteed England did not get there without a scare, winning another close call against Buttler and then seeing off Broad too, but Woakes remained. The winning runs came via a thick outside edge but his knock will go down as one of the very highest calibre.
Man of the match Woakes laid the plaudits for victory at Buttler's feet, in a typically understated review of the first Test.
"We wrested back a bit of initiative, and we just felt it was the way to go on that surface," Woakes told Sky Sports.
"The idea to try to take it to them, and put them under a bit more pressure was probably the right thing to do.
"I was playing second fiddle to Jos, watching him do his thing at the other end.
"But it was a great partnership. He's one of the best run chasers in the world, and he showed why today."
Buttler has revealed he spent some "lonely nights" pondering his role in the England side before producing arguably the best innings of his Test career.
"I feel like I owed the team," he said.
"I was very aware that the chances I missed at wicketkeeper were the reason we were chasing as many as we were. You sit there thinking 'perhaps I've cost the team the game'. It's a feeling of relief more than enjoyment at the minute.
"There's been some lonely nights thinking about it. As the wicketkeeper in this team you have to take chances and you have to keep better than I did in the first innings - I know that, I don't need other people to tell me.
"I expect a lot of myself and to play international cricket there's a level required. And I have to be better - that's a stone-cold fact, there's no point trying to hide that. If I take those chances we might have won two hours earlier.
"Thoughts go through your head that if you don't score any runs it could be my last Test. Those kind of things are in your head but you have to try to shut them out and play the situation. I'm pleased that I am able to do that."
Pakistan skipper Ali was left to lament a golden opportunity lost, but insisted England deserved great credit for grinding out the win.
"It was a wonderful Test match, but disappointing to come out the wrong side of it of course," Ali told Sky Sports.
"Buttler and Woakes took the game on and suddenly the pitch started to do nothing.
"They took the game on, credit to them, they changed the momentum of the game. And unfortunately we couldn't find a reply for whatever they threw at us.
"First of all I would give credit to that partnership. It's tough when someone plays like that to keep the boundaries dry. Sometimes you have to give credit to the opposition.
"From the man of the match (Woakes), this is one of the best innings of recent times for England. Because conditions were tough for the batting side at that moment.
"We had the opportunity to bat England out of the game. Runouts in Test match cricket are kind of a crime, but that happened. We should have had more runs on the board, but I still believe this total was enough for victory as well."