Kane Williamson hit a century and Luke Ronchi smashed 24 runs off one explosive over when the match was still in the balance to steer New Zealand to a four-wicket win over Sri Lanka in the fourth ODI.
Sri Lanka set New Zealand a testing victory target of 277 to win the match at Saxton Oval after being bowled out for 276 in 49.3 overs and the Black Caps reached the mark with 11 balls to spare for the loss of six wickets.
Williamson continued his rich run of form with the bat, scoring 103 off 107 deliveries to provide the backbone of New Zealand's innings.
He was well supported by Corey Anderson, who made a quickfire 47 before being run in the 46th over with the home team still needing 32 for victory.
New Zealand required 25 off the last 18 balls when Ronchi tied the scores in the blink of an eye, blasting three sixes, a boundary and a two off the 48th over from Thisara Perera.
Daniel Vettori spanked a boundary off the first ball of the next over to end the match, leaving Ronchi unbeaten on 32 from 15 balls.
Earlier, Sri Lanka's big three batsmen all made significant contributions to their total but the tourists did not get enough runs from the rest of their lineup on a good batting pitch.
Mahela Jayawardene fell just six runs shy of a century and Kumar Sangakkara made a swift 76 after Tillikaratne Dilshan gave the Sri Lankans a solid platform with 44.
New Zealand lead the best-of-seven series 2-1 after they shared the first two games and the third match in Auckland on Saturday was rained out.
Sri Lanka 276 all out in 49.3 overs (Jayawardene 94, Southeee 3-59)
New Zealand 280-6 in 48.1 overs (Williamson 103, Mathews 1-16)