Tom Latham posted his seventh test century and Kane Williamson narrowly missed his 20th as New Zealand took full control of the first cricket test against Sri Lanka on its second day Sunday.
New Zealand reached stumps at 311-2 in reply to Sri Lanka's first innings of 282 with Latham 121 not out and Ross Taylor 50, having added 90 for the third wicket.
Earlier, Latham put on 59 for the first wicket with Jeet Raval (43) and 162 in a dominant stand with Williamson which tipped the match in New Zealand's favour after it had been in the balance at the end of the first day.
Williamson had seemed to be moving inexorably towards his 20th century and his second in consecutive innings when he made an uncharacteristic error of judgment and was dismissed after taking his 91 runs from only 93 balls.
Latham's innings was plodding in comparison but also represented a welcome return to form. He had scored only two half-centuries in his previous nine innings and the century was his first since January 2017.
"We thought it was going to be a day we really had to work hard for and grind out for a while and we got the rewards at the back end of the day," New Zealand coach Gary Stead said. "I think we picked up around 135 runs in the last session so we're really pleased with where we're at this stage of the game.
"Tom Latham made a fantastic hundred and he did it the hard way, he had to grind it out for a while. Then you saw the class of Kane Williamson who scored a lot more freely as well."
New Zealand began by ending Sri Lanka's first innings three overs after its resumption at 275-9. Tim Southee captured the final wicket, of Lahiru Kumara for 0, to finish with 6-68.
It was Southee's eighth five-wicket haul in tests and his first on the Basin Reserve.
By the time New Zealand started its innings, the sun had baked the pitch and it looked much less threatening than on the first day when it was heavily grassed and when high humidity allowed the ball to swing.
The Sri Lanka new-ball bowlers were accurate and, while Raval scored steadily, Latham took a long time to establish himself at the crease.
New Zealand suffered a troublesome setback when Raval was out to the final ball before lunch, leaving Williamson to wait expectantly through the 40-minute break to begin his innings. When he came out, he struck fours from the first three balls he faced and immediately changed the tone of the day.
His first boundary was a thick edge wide of second slip but his second and third were both firmly and deliberately struck, the first past point and the second over cover point. Williamson also brought up his 50 with a boundary, from only the 45th ball he faced and continued to bat freely, scoring on both sides of the wicket.
Latham reached his half-century from 123 balls, putting behind him his recent run of poor form, and appeared to grow in confidence playing the role of junior partner to Williamson.
Just as the pair seemed likely to give New Zealand complete control of the match, Williamson was out for 91 when New Zealand was still 61 runs short of Sri Lanka's total. He tried for the first time in the match to sweep the spinner Dhananjaya de Silva and flicked a catch to the fielder at backward square leg.
Latham continued New Zealand's onslaught with Taylor who, in reaching his 30th test half-century just before stumps, overtook Brendon McCullum to become New Zealand's second highest test run-scorer. He ended the day with 6,454 runs, ahead of McCullum's 6,453 and behind only Stephen Fleming with 7,172.
Taylor had a life on 23 when he offered a hard chance high and to the right of second slip who couldn't hold the chance.
By stumps, Latham and Taylor had added 90 for the third wicket and New Zealand led by 29 runs.