New Zealand was within sight of its first test victory in Sri Lanka in 14 years after 17 wickets fell on a thrilling penultimate day of the series yesterday.

The Black Caps set Mahela Jayawardene's side 363 for victory after first bowling them out for 244 and making 194 for nine declared in their second innings. By stumps Sri Lanka had slumped to 47 for four as New Zealand dismissed Tharanga Paranavitana (0 ), Tillakaratne Dilshan (14 ), Kumar Sangakkara (16 ) and Jayawardene (5 ).

New Zealand went into the match on the back of five successive losses, its worst run in 57 years.

Its last win in Sri Lanka was in 1998 and it was thrashed in the first test of the series in Galle, losing by 10 wickets inside three days. But thanks to fast bowlers Tim Southee, Trent Boult and Doug Bracewell, along with captain Ross Taylor, it set up the chance of a rare win.

"We are well aware of the history," coach Mike Hesson told reporters. "Results don't lie and five [losses] in a row is hard to take. I'm delighted we have been able to string together four good days, but clearly we have still got a lot of work to do and tomorrow is a huge day for us."