Dimuth Karunaratne thwarted a tiring New Zealand bowling attack to score his maiden Test century on Sunday before Trent Boult snapped up two late wickets to leave the hosts well positioned to wrap up the first Test on the fourth day.
Sri Lanka ended the third day's play at Hagley Oval in Christchurch on 293 for five, still 10 runs away from making New Zealand bat again after they had been asked to follow on by Brendon McCullum when they were dismissed for 138.
Karunaratne, who had resumed on 49, scored 152 from 363 balls before he was bowled by Boult with a beautiful delivery that nipped away off the seam with about 30 minutes remaining in the day's play.
The opener, whose previous best score was 85, was ably supported in an 87-run partnership with Lahiru Thirimanne and then added 96 runs with Angelo Mathews before he was dismissed.
"He dug in, he took his time and he played well in the end," opening bowler Tim Southee told RadioSport of Karunaratne's innings.
Boult then had Niroshan Dickwella (4) caught in the slips with less than three overs remaining to give the hosts hope they will be able to wrap the game up early on the fourth day and take a 1-0 lead in the two-match series.
"I think we deserved a couple towards the end," Southee added. "We bowled pretty well all day on a pretty good surface.
"It's a lot nicer knowing we need five wickets rather six or seven (and) if we can get Mathews, things will be a lot easier tomorrow morning."
Sri Lanka captain Mathews, who ended the day on 53 not out, is the last recognised batsman and while wicketkeeper Prasanna Jayawardene is still a lower-order threat, the tail will be exposed with the fall of one more wicket.
Night watchman Tharindu Kaushal was on five, though he looked increasingly fragile against a fired up Boult and Southee, while offspinner Mark Craig was getting some big turn and bounce out of the footmarks with the old ball.
"I think we bowled well throughout the day," Southee said. "Another day and we could have had them seven or eight down.
"A lot of balls went past the bat and kept us in the game and I think it shows the patience we have shown as a bowling unit.
"We know how to hang tough and hang in there for long periods and we saw the reward for that in picking up those two wickets."