New Zealand's Kane Williamson inched towards his ninth Test century as he combined with BJ Watling to stave off Sri Lanka's push for victory at the close of the third day's play in Wellington.
Williamson was 80 not out, his 16th Test half century, and shared in an unbroken 94-run partnership with Watling (48 not out) to take the hosts to 253 for five at the close, a lead of 118 runs with two days left to play of the second and final match.
"The partnership that Kane and BJ have put on has been outstanding," New Zealand batsman Tom Latham told reporters. "We are fighting our way back and if these guys can keep going for another hour or two hours then we could be set up quite nicely."
The visitors will be ruing missed opportunities to sew up the game within three days after they dropped Williamson twice.
Williamson was put down on 29 by Rangana Herath in a caught and bowled opportunity with the score 132 for four, then dropped in the final session by Nuwan Pradeep at deep backward square leg on 60, just three overs before the second new ball was due.
Sri Lanka had put the hosts on the back foot with three wickets before lunch and then seized control when they reduced them to 159 for five, with the home side holding a 24-run lead and their last recognised pair at the crease.
Hamish Rutherford (40) and Latham (35) had given New Zealand a solid start on Monday, driving their side to 75 without loss in the first hour before Pradeep dismissed both.
Ross Taylor was then deceived by Herath's guile before lunch to leave the hosts floundering.
They slumped even further after lunch when Brendon McCullum (22) was trapped lbw by Dhammika Prasad while Jimmy Neesham was also leg before to Pradeep for 19 before Williamson and Watling took them to the break.
"We lost three quick wickets and just as we managed to build partnerships throughout the innings we lost another one, which is disappointing," Latham added.
"But ... Kane and BJ are clawing our way back (and) I think they are the perfect guys to be out there at the moment."