Wellington, New Zealand: Kane Williamson made 80 and B.J. Watling 48 in an unbroken 94-run partnership that rallied New Zealand to a 118-run lead over Sri Lanka on the third day of the second test on Monday.
New Zealand was 253-5 at stumps, after trailing Sri Lanka by 135 runs on the first innings.
Nuwan Pradeep captured 3-57 to bowl the tourists into a winning position, but then dropped Williamson when he was on 60, giving New Zealand a break that could save its match.
Pradeep dismissed openers Hamish Rutherford (40) and Tom Latham (35) before lunch, then returned in the afternoon to remove Jimmy Neesham (19) when New Zealand was leading by only 24 runs and facing the prospect of a loss that would level the two-test series.
Dhammika Prasad also claimed the vital scalp of New Zealand captain Brendon McCullum, who led the hosts to victory in the first test in Christchurch with a sparkling first-innings total of 195 and had the potential to bat New Zealand back into a position of strength in the second test.
But McCullum was dismissed lbw to Prasad in the 47th over, leaving Williamson as New Zealand's last hope of achieving a substantial lead.
Williamson and Watling stayed together for the remaining 41 overs before stumps, negotiating the arrival of the second new ball to guide New Zealand toward a defensible total with two days of the match remaining.
New Zealand was 205-5, leading by 70, when Williamson pulled a ball from Prasana to Pradeep at backward square-leg and the fieldsman juggled the ball twice before dropping the catch.
A wicket at that point would have exposed New Zealand's lower order, if not its tail, shortly before the second new ball, tipping the match in Sri Lanka's favor.
But Williamson survived and continued to occupy the crease until stumps, supported by Watling, who is trying to bat himself out of a lean patch. He made 26 in the first test at Christchurch and 11 in the first innings of the current test.
New Zealand's scoring rate was pedestrian: Williamson and Watling added their 94 runs in just 40.3 overs. But Sri Lanka's bowling performance also lost focus as the day went on.
At the start, they showed the ability to carefully execute well-set plans to run through the New Zealand top order. Rutherford and Latham had put on 75 for the first wicket when Sri Lanka began to turn the match in its favor by claiming three wickets for 4 runs in the space of 29 balls.
Pradeep began bowling around the wicket to Rutherford, testing him with a series of short-pitched balls. Mathews then moved a fielder to third man but stationed him well in from the boundary and when Rutherford finally took a big swing at a shorter ball, his shot flew directly to the fielder who hardly moved to take the catch.
Latham had played a series of sweet cover drives in the first hour as New Zealand briefly seemed to be getting on top of the Sri Lanka attack.
But he also fell to a well-executed plan: Pradeep, bowling over the wicket and across the left-hander, tempted him to drive again and he feathered an edge to Jayawardene, the ninth dismissal by a wicketkeeper in the match so far.