A record unbeaten fifth wicket stand between skipper Kane Williamson and Henry Nicholls has put New Zealand in a commanding position heading into the final day of the third and deciding test against Pakistan in Abu Dhabi.
At stumps on day four Williamson was not out on 139 and Nicholls not out 90 with the Black Caps 272-4 - an overall lead of 198.
Resuming on 26-2, the Black Caps lost nightwatchman William Somerville (4) in the seventh over of the day as the debutant was trapped in front of the wicket by leg-spinner Yasir Shah.
Shah's fifth wicket of the contest in his 33rd Test saw him replace Australian Clarrie Grimmett as the fastest man to claim 200 Test victims.
Grimmett, also a leg-spinner, had reached the 200 mark in his 36th Test against South Africa 82 years ago.
Pace bowler Shaheen Shah Afridi then had Ross Taylor (22) caught at square leg as New Zealand found themselves 60-4.
Taylor's departure brought Nicholls to the crease and both he and Williamson rode their luck to put on an unbroken 212-run stand with Williamson surviving chances while on 80 and 106, while Nicholson also offered a sharp chance which was put down allowing him to bring up his 50.
Williamson's century was his 19th in tests and Black Caps batting coach Craig McMillan said it was an impressive effort given he arrived at the crease when the score was on 24 for 2.
"He had to work very hard... there was certainly some help and turn in the surface for Yasir Shah and (offspinner) Bilal and they stuck at their task pretty well," he said.
"I don't want to rank it because it's his 19th test century and there's going to be a number more in the years to come but suffice to say it's a very special innings and hopefully it can propel us to a test victory which will make it even more special"
New Zealand won the opening test in Abu Dhabi by four runs before Pakistan squared the three-match series with victory in the second Test in Dubai by an innings and 16 runs.
Look back over the match commentary here: