New Zealand 412 (Taylor 142, Williamson 135, Herath 6-103) and 194 for 9 dec (Taylor 74) beat Sri Lanka 227 (Samaraweera 76, Mathews 47, Southee 5-62, Boult 4-42) and 195 (Mathews 84, Southee 3-58, Boult 3-33) by 167 runs
Scorecard and ball-by-ball details

New Zealand shrugged off five consecutive defeats with one of their most memorable victories in recent times, squaring the two-Test series with a 167-win at the P Sara Oval. Hammered in under three days in Galle, New Zealand stretched the hosts in Colombo by holding the edge over all five days and rounded things off just after tea, despite a resilient 84 by Angelo Mathews.

It was New Zealand's first Test win in Sri Lanka since 1998, and in a remarkable coincidence, that victory at the R Premadasa Stadium was also by the same margin. This win drew parallels with their inspiring win at Hobart a year ago. On both occasions, New Zealand were hammered in the first Test, but stunned the hosts by showing the resolve to fight back. While the Hobart Test was anybody's game till the final moments, this Test was dominated by the visitors and coming into the final day, the only realistic outcomes were a New Zealand win and a draw.

New Zealand's penetrative seam attack - one of the positives to come out of an otherwise horror of a year - set it up by getting the top four the previous evening. The twin failures of the top order were responsible for Sri Lanka's struggle through the Test. It meant that Sri Lanka were left with only one option - to play for a draw. They had to derive inspiration from Faf du Plessis' marathon effort at the Adelaide Oval earlier this week to deny Australia.

Mathews was the only batsman who looked like emulating du Plessis, but lacked support to help him last the distance. Thilan Samaraweera's early departure, due to a communication breakdown early in the morning, only made the task tougher for Mathews. Dropping the ball towards short cover, Samaraweera set off for a non-existent single and was three-fourths down the pitch but Mathews wasn't interested. Jeetan Patel threw the ball to the wicketkeeper, who broke the stumps before a deflated Samaraweera could make his ground.

The wicket put Mathews' survival skills to test. With the seamers swinging it towards the pads, the captain Ross Taylor set unconventional fields for Mathews, placing a silly mid-on and two fielders close at short midwicket on one occasion. Only five boundaries were scored in the morning session, with the focus more on wearing the bowlers down.

The afternoon session was dominated by spin, with a spinner operating from one end for the entire duration. Tim Southee bowled round the wicket with a packed on side field, with a short leg, backward short leg and short square leg to create some opportunities. Doug Bracewell, for a short period, bowled short of a length to Mathews with the wicketkeeper up to the stumps.

The Prasanna Jayawardene-Mathews stand frustrated New Zealand for 35.3 overs. New Zealand tried hard to create chances, placing fielders around the batsman when the spinners were on. The breakthrough after lunch came via Todd Astle, who generated good drift with his leg breaks. The one that got Jayawardene was one that drifted away and bounced more, clipping the shoulder of the bat. Suraj Randiv lasted only 11 deliveries, when he edged Trent Boult to second slip.

Nuwan Kulasekara joined Mathews to add 46. Astle bowled loopy full tosses, that were clubbed over deep midwicket by Kulasekara and Mathews too used his feet to Patel and smashed a six over long-on.

New Zealand were waiting to get hold of the second new ball to unleash their seamers. They would have been anxious to get quick breakthroughs and avoid a last-minute scramble for wickets, keeping the weather in mind. Poor light had curtailed play in the final session in the first four days, but Sri Lanka couldn't stick around long enough for any divine intervention.

Boult got the breakthrough straight after tea when he had Kulasekara fending to Kane Williamson who took a low catch at gully. Williamson, who plucked a brilliant catch in the same position on the fourth day, took another stunner when he took one inches off the ground to get rid of Shaminda Eranga. The third umpire studied several replays before giving it out. Boult rounded off the match when he had Mathews edging to Martin Guptill at second slip, giving New Zealand their second* Test win in 2012.

*6:52GMT, November 30: The report had previously said this was New Zealand's first win in 2012. This has been corrected.

Kanishkaa Balachandran is a senior sub-editor at ESPNcricinfo