New Zealand secured a thrilling final-hour victory in the first Test against Pakistan to boost their hopes of making the World Test Championship final.
Spinner Mitchell Santner had last man Naseem Shah caught and bowled with just 4.3 overs left in Mount Maunganui.
The tourists began 71-3 needing to bat out the day for a draw or score 373 to win, and Fawad Alam hit 102, sharing a 63.2-over stand with Mohammad Rizwan.
Rizwan fell with 25 overs left before the hosts took the final five wickets.
Neil Wagner, who broke two toes earlier in the match, had Fawad caught behind to end his 269-ball, six-hour knock, which had seen the 35-year-old score his second Test century 11 years after his first.
Last pair Naseem and Shaheen Afridi survived seven overs in fading light before Santner finally broke their resistance, catching Naseem’s miscued drive one-handed above his head.
New Zealand can go second in the World Test Championship table if they win the series 2-0. The top two teams will compete in the final at Lord’s next summer.
The Black Caps will also secure top spot in the International Cricket Council’s Test rankings if they win or draw the second Test which starts on 2 January.