Sri Lanka 237 for 4 (Dhananjaya 34*, Mathews 34*, O'Rourke 3-37) and 305 lead New Zealand 340 (Latham 70, Mitchell 57, Jayasuriya 4-136) by 202 runs
Fifties from Dimuth Karunaratne and Dinesh Chandimal were followed by steadying knocks from Angelo Mathews and Dhananjaya de Silva and Sri Lanka stretched their lead to 202 by the close of play on day three in Galle.
The latter pair had put together an unbeaten fifth wicket stand of 59 when an extended final session came to a close, as Sri Lanka inched forward their hard-fought advantage - the foundations of which had been sown earlier.
Prabath Jayasuriya, ragged on day two, was on the money on the third morning adding three scalps to his overnight tally to end with innings figures of 4 for 136, while Ramesh Mendis grabbed two himself to finish on 3 for 101.
This was then followed by a a 147-run stand between Karunaratne and Chandimal, which had it been allowed to continue longer would have certainly taken the game away from New Zealand.
It was brought to an end, partly by the visitors' persistence with their plans and the wearing pitch. With Ajaz Patel consistently seeking to exploit the growing patch of rough outside the left-hander's off stump - so much so that even against the right-handers a leg stump strategy was employed - he finally got one to spit and sneak under Karunaratne's sweep, to crash into the stumps.
That gave New Zealand the opening they were looking for as Will O'Rourke was swiftly brought back to attack the new batter. He would dismiss the other set batter in Chandimal, who would flick one straight to leg slip.
O'Rourke's unsettling pace and bounce continued to trouble Sri Lanka's batters and he ended up with further rewards for his efforts, getting Kamindu Mendis to edge behind. This put him on to eight wickets for the Test, on the verge of a 10-wicket match haul.
With the ball turning more prodigiously as the day wore on, neither Mathews nor Dhananjaya had an easy stay at the crease, but they found runs when offered and rode their luck on other occasions.
Even as late as the final few overs and over 100 deliveries into their stand, there was a potential Dhananjaya outside edge that flew past the outstretched hands of Daryl Mitchell at first slip, while Mathews survived an incredibly close leg before shout - only surviving on umpire's call with regard to the line of impact.
But when Karunaratne and Chandimal were at the crease, batting seemed a lot easier, while any pitch-related demons were largely in hibernation. Their partnership was a lesson in discipline and opportunism.
As New Zealand peppered good lines and lengths outside off, time and again both batters, particularly Karunaratne, refused to engage. When the lines tightened closer to off, he was equally adept at either going back or reaching the pitch to defend. It helped that the pitch also seemed to be easing up under the bright sunshine.
Chandimal, while not as comfortable defending, sought other methods - primarily the sweep and reverse, to shift the pressure whenever the bowlers sought to settle into a rhythm - while he also was keen to use his feet. Both batters were also swift in punishing anything dragged short - Karunaratne's most productive shot, in fact, being the cut.
While boundaries weren't a feature of either of their innings, they were used as a tool to relieve any building pressure. But for the most part, it was clever manoeuvring for ones and twos that ensured the pressure valve never reached uncomfortable levels.
The important stand helped cement a resurgent day that had begun with Sri Lanka grabbing the final six New Zealand wickets for just 89 runs inside the morning session.
Sri Lanka had started the session brightly, sticking to consistent lines and lengths, and forcing the New Zealand batters to make things happen. For the most part, New Zealand were up to the task - particularly Mitchell, who seemed in imperious form as highlighted by a disdainful loft down the ground off Lahiru Kumara. Mitchell's footwork was also positive, very much in line with the approach New Zealand had utilised to such devastating effect on day two.
But the lifeline Sri Lanka were seeking arrived courtesy of an ill-advised single to cover. Glenn Phillips called for the single, but Mitchell, by then on 57, was marginally slow off the mark, and that was all it took to find him inches short at the striker's end. With Mitchell at the crease, Sri Lanka were staring at a deficit potentially beyond 100, but suddenly they scented blood.
The next few wickets fell quickly as Jayasuriya and Mendis ran through the tail. When it was all settled, New Zealand's first-innings lead stood at 35 after they were bowled out for 340.
It's an outcome Sri Lanka would have snapped up if it were offered to them at the start of the day, one which New Zealand had begun 50 runs behind with six wickets in hand. But by the innings' close, you wouldn't have begrudged them a feeling of mild disappointment at having given the visitors so many.
New Zealand, by contrast, would be grateful for each of those 35 runs, having lost five wickets for 50 runs inside the first hour of play. Phillips made the difference in that sense, as he plundered an unbeaten 48-ball 49, including some monster hits against Jayasuriya, before the last man O'Rourke was dismissed. Those runs, though, might still prove handy.