New Zealand have secured an unlikely 18-run first-innings lead over Sri Lanka on day three of the first test, with Daryl Mitchell leading the rearguard rally at Hagley Oval.
Mitchell compiled his fourth test century - and first against Sri Lanka - to bring the Blackcaps within 64 runs of the visitors' total, before Matt Henry and Neil Wagner smashed them past the target, with a 61-run partnership off 49 balls for the ninth wicket.
At tea, the subcontinent side had reduced that deficit to nine runs.
The Blackcaps began the day reeling at 162/5, with Mitchell and Michael Bracewell tasked with inspiring a revival.
Bracewell fell for 25 runs, after he nicked spin-bowler Prabath Jayasuriya to wicketkeeper Niroshan Dickwella right before the drinks break.
Blackcaps captain Tim Southee came to the crease in an adventurous mood and quickly signaling his intent to attack the Sri Lankan bowlers. He found the boundary rope on four occasions, including a six, before succumbing to a spectacular catch in the deep.
Southee looked to clear Kasun Rajitha, but a flying Lahiru Kumara ended his illustrious innings with a full stretch dive to his left at deep-backward square.
Henry looked comfortable before lunch and supported Mitchell through to his ton, before the middle-order survivor finally fell for 102, knicking Kumara behind to Dickwella.
Mitchell's departure was a signal for Henry to unleash, as he carried New Zealand past Sri Lanka's first innings with a 24-run over off Kasun Rajitha that featured four fours and a six. He was bowled next over by Asitha Fernando, but had struck 72 runs off 75 balls.
Wagner joined the party with 27 runs off 24 balls, before he also fell to Fernando, caught Dhananjaya de Silva, to bring the innings to an end at 373.
Sri Lanka 355 (Mendis 87, Karunaratne 50, Mathews 47, de Silva 46; Southee 5/64, Henry 4/80) NZ 373 (Mitchell 102, Henry 72, Latham 67; Kumara 3/76, Fernando 4/85)
New Zealand lead by 18 runs after the first innings