New Zealand beat Pakistan by 101 runs to end the first Test in Mount Maunganui in a sensational manner as the tourists were only 27 balls away from salvaging an incredible draw.
Tail-enders Shaheen Afridi and Naseem Shah valiantly stayed at the crease for seven overs in fading light before teenager Naseem was removed by Mitchell Santner to bring curtains to Pakistan's defiance.
Naseem chipped the fuller-length ball towards the bowler as Santner timed his jump perfectly to pluck the ball from thin air.
Pakistan's agonising demise was hastened by Kyle Jamieson, who celebrated his 26th birthday by breaking the stellar 165-run stand between Fawad Alam and Mohammad Rizwan.
The hard-fought victory has ensured New Zealand climb to the top of the ICC Test rankings and remain in the hunt for the World Test Championship final at Lord's next summer.
Jamieson's crucial scalp of Rizwan for 60 was followed by Neil Wagner, battling the pain of two broken toes, dismissing Fawad to expose Pakistan's slender tail.
Pakistan eventually collapsed from 240/4 to 271 all out in the last session, though Shaheen and Naseem offered impressive resistance in the final hour.
A rejuvenated Jamieson was at the forefront of New Zealand's dominance after the tea break as he conceded only four runs in nine overs and took two wickets to trigger Pakistan's slide.
New Zealand had a firm grip on proceedings when Azhar Ali got out in the second over of the day leaving Pakistan 75 for four in pursuit of the unrealistic target of 373.
Pakistan's stand-in skipper Rizwan and Fawad then occupied the crease for more than 63 overs during an epic partnership to raise the team's hopes of earning a draw.
At one point, the two had narrowed the target down to 158 in 36 overs, creating a glimmer of hope regarding an improbable victory push but Rizwan's wicket stalled this distant dream.
Jamieson's lbw shout against Rizwan was initially turned down by the on-field umpire but New Zealand opted for a successful review.
Fawad's remarkable century was the highlight of Pakistan's tremendous fightback as he scored his first Test ton after being unceremoniously dropped from the red-ball side over 10 years ago.
Fawad made a career-best score of 168 on debut against Sri Lanka and was discarded from the team after just three Tests.
He was briefly a part of Pakistan's white-ball team in 2014-2015 but his next Test came only earlier this year in England.
There were a few nerves in the initial phase of his innings but Fawad braved through the tense moments and prevailed in a fantastic 269-ball vigil.
He staunchly held his own throughout the innings and brought up his century with a crisp pull shot for four off Wagner. Fawad's glorious knock was applauded by spectators all across the stadium while the dressing room gave him a standing ovation.
He ultimately fell to his nemesis Wagner in a similar fashion to how he was caught down the leg-side off the rising short ball in the first innings.
New Zealand's frontline pace quartet shared eight wickets between them and specialist spinner Santner bagged two lower-order wickets.