Shehzad hit 14 fours in his unbeaten 126 and Azhar was 46 not out as Pakistan, who completed a 2-0 series victory over Australia at the same venue last week, look to continue their rich vein of form in the three-match series against New Zealand.
Pakistan captain Misbah-ul-Haq opted to bat first and after pacemen Trent Boult and Tim Southee had sent down the first eight overs, New Zealand skipper Brendon McCullum introduced spin from both ends.
The ploy nearly paid dividends when Shehzad, on 16, came charging down the track against off-spinner Mark Craig and misjudged the flight but BJ Watling fumbled behind the stumps and could not collect the ball, allowing the batsman to scurry home.
India-born leg-spinner Ish Sodhi was unlucky when Hafeez’s outside edge found Ross Taylor in the slips but a TV replay suggested the ball might have bounced before being caught.
Hafeez pulled Southee to bring up his fifty after lunch and Shehzad took two off Sodhi to complete his half-century.
All-rounder Corey Anderson denied Hafeez a century, deceiving him with a clever change of pace and the batsman gave return catch to the bowler. Hafeez’s composed 137-ball knock contained 10 fours.
Shehzad, however, could not be denied his hundred which he brought up with a single off James Neesham.
Azhar also had his share of luck, being dropped by Watling behind the stumps after fluffing a reverse sweep against the luckless Craig.
McCullum even game himself a bowl at the Pakistani batsman, more in desperation than in any real hope of breaking the blooming Shehzad-Azhar partnership.
(Reporting by Amlan Chakraborty in New Delhi; Editing by Ed Osmond)