New Zealand fast bowlers Tim Southee and Trent Boult ensured their side remained in charge of the second cricket test against Sri Lanka on Monday, reducing the home side to 43 for three at the close.
New Zealand had reached 412 in their first innings thanks largely to a record third-wicket partnership of 262 between captain Ross Taylor (142) and Kane Williamson (135), before Southee took two for 16 and Boult one for 16.
At one stage Sri Lanka were 12 for three thanks to Boult and Southee's triple breakthrough before Tharanga Paranavitana (9) and Angelo Mathews survived (20) to the close without further loss.
Sri Lanka remain in a precarious position as Thilan Samaraweera may have problems batting after suffering a cut to the webbing on his right hand while fielding which required three stitches.
Southee started the rot with the first two wickets of the Sri Lanka innings in three balls, bowling the fit-again Tillakaratne Dilshan between bat and pad for five and then causing Kumar Sangakkara to top-edge a hook-shot to fine leg to perish for a duck.
Boult got in on the action when he induced Sri Lanka captain Mahela Jayawardena (4) to edge a loose drive to gully, where Williamson pouched a low chance.
"To get three wickets before stumps was a great start and the bowlers have been bowling really well throughout this series," Williamson told Reuters.
"It was a good day all round and finishing off with the wickets was great. I think we're in a good position but, saying that, it's a very good track and we've got to bowl that side out twice to get a victory.
"They have got some seriously good cricketers and so that's not going to be an easy feat (to win)."
Resuming at 223 for two, Taylor and Williamson took their stand to 262, a New Zealand record for all wickets in Sri Lanka, beating the unbroken 246 of Jeff Crowe and Richard Hadlee at the Colombo Cricket Club in 1987.
Williamson, who resumed on 95, moved to his third test hundred in 253 balls with nine fours and also got to 1,000 runs in the longest form of the game, becoming the youngest New Zealand batsman to reach that mark at 22 years 110 days.
"It's been a tough tour with not having much time in the middle but I've been working really hard in the last week or so and so it's nice to have put together this innings," said Williamson.
The pair were eventually separated when Taylor, who started the day on 119, missed an attempted sweep at left-arm spinner Rangana Herath (6-103) after hitting 11 fours in an innings in which he faced 388 balls.
Williamson fell in similar fashion five overs later after just over seven hours at the crease, during which time he hit 12 fours.
With Kruger van Wyk (0) and debutant Todd Astle (3) following in quick succession either side of lunch, New Zealand were in danger of squandering the hard work of day one.
That they did not was due to Daniel Flynn who made 53, his second half-century of the series, and helped to steer New Zealand past 400 for only the second time in 10 tests this year.
Flynn, like Williamson, also eased past 1,000 test runs during his innings before he was dismissed by Herath, who claimed his third successive five-wicket haul in the series.
Herath now has 52 wickets in this calendar year, one behind the leading test wicket-taker in 2012, England's Graeme Swann.