A sensational partnership between Kane Williamson and Henry Nicholls has not only saved the Black Caps from potential peril - it's put them in the box seat for a famous away test series win.
Joining forces at 60-4, with the Black Caps still trailing Pakistan by 14 runs, Williamson and Nicholls needed to produce something special to stop a hefty defeat, and boy, did they deliver.
By the end of the day, a casual 390 minutes after they had paired up, the Black Caps were sitting pretty at 272-4 – a lead of 198 runs.
It's a position of power – some quick runs in the first session on day five can lead to a declaration, and force Pakistan into a tricky fourth innings chase on a wicket that could still produce some demons on the final day.
For the first time all series, the Black Caps utterly dominated a day. Williamson was brilliant, bringing up his 19th test century in a sublime innings. The Black Caps captain attacked width against the Pakistan seamers – especially potent through cover and mid-wicket - and again looked a class above when playing against spin as he reached 139 at stumps.
In the past five years, Williamson averages 67.16 in when batting in the second innings, nearly 15 runs higher than the next qualified batsman, and his effort on the Abu Dhabi wicket was as good as any he had previously produced.
Nicholls was a perfect partner, playing a steady hand with few rash shots as he finished the day unbeaten on 90. The pair added an unbroken 212 – the highest fifth wicket partnership for the Black Caps against Pakistan.
As a result, their chances of a first away test series win over Pakistan in 49 years look promising. Before, the realistic path to victory required another Pakistan batting collapse. Now, the Black Caps can set the agenda, making Pakistan have to play aggressively if they want to win, and in turn creating opportunities for their bowlers.
It must be said though, that after all of this, a draw does loom as the most likely result. It would be anti-climactic, but Pakistan could decide to shut up shop on the final day if they feel their chances of victory are minimal.
But, also for the first time this test series, Pakistan are rank outsiders – a fact that would have seemed oh so unlikely in the first session.
Having started the day at 26-2, the early wickets of nightwatchman Will Somerville and Ross Taylor had severely dented the Black Caps' hopes of victory. Yasir Shah was again heavily involved, with the Pakistan legspinner becoming the fastest player to 200 test wickets when he claimed the scalp of Somerville. Somerville was trapped lbw for four, giving Shah his 200th wicket in just 33 matches — breaking the 82-year-old record held by New Zealand-born Australian legspinner Clarrie Grimmett.
That brought Taylor to the wicket, and he never looked like he was going to stay around for long. Aggressive batting saw him reach 22 from 14 balls, including a pull shot for four from Shaheen Afridi.
However, he was unwittingly lured into Pakistan's trap, pulling at another short ball from Afridi and picking out Bilal Asif on the square leg boundary. It drew a laugh from Pakistan coach Mickey Arthur, who knew the plan had worked to perfection.
He wasn't laughing when Williamson and Nicholls began to work their magic.
In truth, the partnership was nearly culled after it had barely begun - Nicholls survived two reviews before he had reached double figures, with Pakistan using up all of their reviews out of desperation to end what was always going to be a decisive partnership.
It was an understandable decision, as it was an essential combination — after Nicholls, BJ Watling was the Black Caps' only specialist batsman remaining, so one breakthrough could have started a collapse and given Pakistan a small total to chase in the fourth innings.
Instead, the Black Caps batted, and batted, and batted some more, offering few chances for Pakistan to regain the ascendancy.
Their best chance for a breakthrough came when Williamson was on 80, and pulled hard at a delivery from Asif. It travelled quickly to Shah at square leg, but he shelled a head-high catch – a chance a better fielder would likely have snagged.
It was one of two chances for Shah to dismiss Williamson – he couldn't cling on to a caught and bowled chance on 106 either – but those were the only offerings in a superb – and possibly match-winning - innings.
Nicholls looked just as comfortable after his review-heavy start, continuing a fine series in which he has increased his reputation as a long-term fixture in the middle order.
After a vital 55 in the first test, and 77 in the second, Nicholls can push on for his third test century on day five, and it would be the least he deserves.
The Black Caps will feel they deserve a test – and series – victory, and while a draw may be the most likely option, for such a thrilling, tumultuous series, it seems fitting that all three options are possible on what should be a riveting final day.