A sparkling century by Tom Latham powered New Zealand's first innings reply after Sri Lanka posted 244 on day three of the rain-hit second Test in Colombo on Saturday.
Latham, on 111, put together an unbeaten 70-run stand with BJ Watling, on 25, to thwart the Sri Lankan bowling attack that had made early inroads into the Kiwi batting.
The tourists were 196 for four at stumps, still trailing Sri Lanka by 48 runs.
Earlier Dhananjaya de Silva made 109 to lift Sri Lanka after they resumed the day on 144 for six following their decision to bat first.
But Latham made the day his own as he registered his 10th Test hundred -- fourth against Sri Lanka -- to hold the New Zealand innings after they lost key wickets including skipper Kane Williamson for 20.
Latham combined the right dose of caution and aggression as he hit 10 boundaries in his 184-ball stay at the wicket so far.
Off-spinner Dilruwan Perera opened the bowling for Sri Lanka and claimed two wickets, dismissing opener Jeet Raval, for nought, and Henry Nicholls, for 15.
Paceman Suranga Lakmal sent Williamson trudging back to the pavilion after the batsman edged an away-going delivery to be caught at second slip.
Latham and Ross Taylor, who made 23, tried to steady the innings by putting together 50 runs before left-arm spinner Lasith Embuldeniya broke the partnership.
Embuldeniya drew Taylor out of his crease only for the batsman to edge the ball to slip.
Sri Lanka's wicketkeeper Niroshan Dickwella had to leave the field after damaging the little finger of his left hand while attempting a catch off a Kumara delivery.
In the morning session, De Silva moved from his overnight 32 to complete his fifth Test century.
Kiwi quick Tim Southee took four wickets while pace partner Trent Boult got three.
De Silva, who was dropped on nine by paceman Boult off his own bowling on day two, put on crucial partnerships including a 43-run stand for the eighth wicket with Suranga Lakmal.
The middle-order batsman, who hit 16 fours and two sixes in his 148-ball stay, reached his century with a boundary to third man off Southee as he raised his bat to the applauding dressing room.
After the first two days were affected by rain, the third day's play witnessed 90 overs despite a 28-minute delay due to rain in the final session.
Sri Lanka lead the two-match series 1-0.