Trent Boult became only the third New Zealand player to claim a one-day international hat-trick as the Black Caps secured the first victory of their tour against Pakistan.
Pakistan won all three Twenty20 clashes but the tourists come out on top in the first ODI despite only managing 266-9 in Abu Dhabi, with new father Boult the star of the show.
Playing his first match of the tour, the 29-year-old took three wickets in just the third over of the Pakistan reply, bowling Fakhar Zaman (1) before having Babar Azam caught by Ross Taylor and then trapping Mohammad Hafeez lbw for first-ball ducks.
Only Danny Morrison and Shane Bond had previously taken hat-tricks in the one-day format for the Kiwis.
That left Pakistan 8-3 in their chase of 267 but they rallied, with Sarfraz Ahmed (64) and Imad Wasim (50) putting on 103 for the seventh wicket to give them a chance of victory.
But, when Wasim became the eighth man out with the score on 219, the game was up and Pakistan lost their final three wickets without adding a run as they fell to a 47-run defeat.
Earlier, Taylor top-scored with 80 and added 130 alongside Tom Latham (68), while a late partnership of 42 between Tim Southee and Ish Sodhi was also important.