(Reuters) - Neil Wagner ripped through Pakistan's tail with three wickets in six deliveries to help New Zealand dismiss the visitors for 230 and secure a 138-run victory on the final day of the second test at Seddon Park in Hamilton on Tuesday.
The victory also wrapped up the series 2-0 for Kane Williamson's side, their first series victory over Pakistan since 1985, after they won the first match by eight wickets in Christchurch.
"We were under pressure, they're a very strong side and are not number two in the world for no reason," Williamson said in a televised interview. "They showed that today, but we were able to stick at it and get the result."
The fifth day had meandered along for the first two sessions as Pakistan openers Azhar Ali and Sami Aslam looked to give themselves a base from which to challenge the 369-run target.
The pair put on 131 for the first wicket before stand-in captain Azhar (58) got a thick inside edge to a looped delivery from left arm spinner Mitchell Santner and played on just before tea.
The visitors, however, with 211 runs needed from 34 overs in the final session and with nine wickets in hand, changed their approach after the break and decided to attack.
Once Babar Azam (16) was dismissed in the same fashion as his captain shortly after tea the shackles were broken.
Aslam was caught nine runs short of a maiden test century at mid-off by Williamson off Tim Southee, and when power-hitting wicketkeeper Sarfraz Ahmed (19) was run out to reduce the visitors to 199 for four, momentum had swung back towards the hosts.
Southee and Matt Henry made the most of the second new ball to extract some swing and seam with Asad Shafiq caught at point from a leading edge from Henry, before Younus Khan was given out lbw to Southee on review for 11 after he failed to play a shot.
Wagner then ran through the tail with Mohammad Amir and Wahab Riaz both caught by wicketkeeper BJ Watling for ducks, before Tom Latham produced a brilliant catch at forward short leg to dismiss Imran Khan and end the match and series.
"We came in and knew the target was a big one but we wanted to have a good partnership up front and then see what we could do after that," Azhar said.
"We had that partnership but couldn't really get the run rate going and I think we .. probably left a little too much to do in the last session."
Pakistan had not lost a series since they were beaten 2-0 in Sri Lanka in August 2014, winning five and drawing two, which included one drawn series in England earlier this year that gave them the top test ranking before India moved past them.