Dimuth Karunaratne scored his maiden Test century to keep Sri Lanka's hopes of salvaging a result against New Zealand alive at Christchurch at tea on day three.
Karunaratne and Lahiru Thirimanne started the afternoon session with the score on 131-2 as the tourists had lost two wickets in the morning.
The duo continued their solid stand as they reached their 50 partnership of 186 deliveries, despite some quality bowling from the New Zealand attack.
Karunaratne brought up his much-deserved century off 255 balls as he edged the ball through gully off Trent Boult.
However, the 26-year-old and Thirimanne could not reach their 100 partnership as Thirimanne fell to the bowling of James Neesham when he was caught behind by BJ Watling for a patient 25.
Karunaratne continued his resilient knock alongside skipper Angelo Mathews to take the tourists past 200-run, and within 102 runs of forcing the home side to bat again, with seven wickets remaining in their second innings.