New Zealand never really challenged Pakistan's imposing 293 for seven, with Martin Guptill (39), Jamie How (24) Scott Styris (46) and Kane Williamson (42) all getting starts but leaving too many runs for the lower order to overhaul the total.
Skipper Afridi also cleverly rotated his bowlers, who expertly changed their pace and angles, bowled to their fields and took wickets just as New Zealand's batsmen appeared set to push on.
Tim Southee (13 not out) hit a six off the last ball to drag New Zealand to 250 for nine. Hamish Bennett was with Southee on four.
"We got a few starts and didn't go on," New Zealand captain Ross Taylor said in a televised interview. "All credit to them I think Umar Gul bowled really well and took it away from us."
The six-match series is locked at 1-1 after New Zealand won the first match in Wellington by nine wickets last week and the second in Queenstown was washed out on Wednesday.
Pakistan's innings had been held together by Hafeez (115), who also shared a 94-run partnership with Misbah-ul-haq (35) and 52 runs with Umar Akmal (44).
"I was just concentrating on the game. I missed a couple of opportunities in the test series so I was looking forward to scoring runs in this match," Hafeez said.
"We were all looking forward to winning this game... and it was a good team effort."
Afridi scored a blistering 65, which included five sixes and five boundaries, as he and Umar blasted a destructive 69-runs off 26 balls as Pakistan made full use of the final powerplay, scoring 126 runs in the last 10 overs.
Afridi's half century was brought up on his 19th delivery, equalling the fastest one-day international half century scored in New Zealand, which is also held by Brendon McCullum.
"I think you have to give credit to Shahid Afridi," Taylor added. "He batted very well. The boundaries here are very small but he cleared them with some massive sixes."
COMMENTS (5)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ