A hobbling Kane Williamson guided New Zealand to 142 for five at the close of play on the third day of the second Test against Sri Lanka in Hamilton, with the hosts needing another 47 runs to seal a 2-0 series sweep.
New Zealand won the first Test in Dunedin by 122 runs, though Sri Lanka are still in with a chance of pinching a win on Monday to draw the series.
Williamson, who was limping noticeably and was seen to have heavy strapping around his right knee, was on 78 while BJ Watling was on nought as they chased the target of 189.
Dushmantha Chameera, who took a career-best 5-47 in New Zealand's first innings with a fiery display of fast bowling, took four wickets in the second before Suranga Lakmal picked up Mitchell Santner for four just before the close.
Chameera gave Sri Lanka a perfect start when he dismissed Tom Latham (four) and Martin Guptill (one) with short-pitched deliveries to reduce the hosts to 11-2.
Williamson and Ross Taylor (35) then settled the run chase in a 67-run partnership before Taylor was caught on the boundary for 35 and then captain Brendon McCullum at mid-off for 18 to send some jitters through the New Zealand camp.
New Zealand were set the small victory target after a surreal period of play after lunch when the hosts took the last seven Sri Lankan wickets for 46 runs in 8.1 overs, bowling them out for 133.
Tim Southee began the collapse when he took three wickets in 14 deliveries to run through Sri Lanka's middle order after they had resumed on 85 for three.
Neil Wagner also grabbed two wickets after lunch before Southee took his fourth when Nuwan Pradeep was caught behind for a three-ball duck to end the innings.
The visitors had been comfortable until about 30 minutes before lunch having cruised to 71 without loss.
Doug Bracewell then grabbed two wickets in an over, dismissing Dimuth Karunaratne (27) and Udara Jayasundera (0) with short deliveries.
Wagner grabbed another wicket in the penultimate over before lunch when he had the dangerous Dinesh Chandimal caught for four at leg gully by Guptill.
The hosts then did more damage after the break, with only some counter-attacking blows from Milinda Siriwardana, who blasted three fours and two sixes in his 18-ball innings of 26, padding Sri Lanka's score.
All 10 wickets fell for 62 runs in a little over 80 minutes of play.
Scorecard
Sri Lanka 1st innings: 292
New Zealand 1st innings: 237
Sri Lanka 2nd innings: 133
New Zealand 2nd innings
T. Latham c Pradeep b Chameera 4
M. Guptill c Karunaratne b Chameera 1
K. Williamson not out 78
R. Taylor c Vandersay b Chameera 35
B. McCullum c Mathews b Chameera 18
M. Santner c Chandimal b Lakmal 4
B. Watling not out 0
Extras: (NB-2) 2
Total: (for 5 wickets, 42 overs) 142
Fall of wickets: 1-4, 2-11, 3-78, 4-130, 5-142.
Bowling: Chameera 13-1-45-4, Lakmal 10-3-19-1, Herath 9-0-39-0, Pradeep 9-1-35-0, Mathews 1-0-4-0.