Sri Lanka were bowled out for 298 on Saturday, 5 January, but not before Perera lit up the Bay Oval with eight fours and 13 sixes in a display of the most outrageous batting. However, he couldn't quite take his team over the line.
The loss means that Sri Lanka conceded an unassailable 2-0 lead in the three-match series to the hosts.
Chasing another tough target, Sri Lanka lost Niroshan Dickwella (9) and Kusal Perera (4) early in the innings and were reduced to 63/2 in the 14th over. But Danushka Gunathilaka launched a counter-attack and led Sri Lanka's hopes of levelling the series.
He scored at almost a run a ball throughout his stay at the crease, bringing up his 50 off 53 balls. But little support from the other end meant that the pressure of the scoring rate kept mounting.
Kusal Mendis (20) added 49 runs with Gunathilaka for the third wicket, but the former's dismissal, caught down the leg side by wicket-keeper Tim Seifert off Ish Sodhi, initiated a collapse that saw Sri Lanka lose 5/16 to slip to 128/7. Sodhi caused havoc, dismissing Dinesh Chandimal and Seekkuge Prasanna as well.
Wickets tumbling at the other end made Gunathilaka swipe across one and top edge it high in the air, only for Seifert to get under it to dismiss the Sri Lankan for 71.
But Perera kept the tourists in the game with a 28-ball 50, hitting Sodhi for two consecutive sixes and a four in an over, and Southee for two fours in the over before. It slightly spoilt Sodhi's figures, as he finished on 3/55 from 10 overs.
Perera and Malinga added 75 runs for the eighth wicket in less than 10 overs, during which Malinga was dropped twice – by Colin Munro off Trent Boult and then by Boult himself off Matt Henry. They were only a couple in a slew of poor fielding efforts from the hosts. A slower one from Boult finally bowled Malinga in the 36th.
Gunathilaka led Sri Lanka's charge with an impressive 71 Gunathilaka led Sri Lanka's charge with an impressive 71 Perera continued his assault, to bring up his maiden ODI hundred off just 57 balls – the fastest ODI ton against New Zealand, ever – smashing Boult for three sixes in two overs and benefiting from a dropped catch by Williamson at long-off on 79.
With 69 needed off eight overs with two wickets in hand, it looked like Sri Lanka could do it if Perera stayed at the crease, but Jimmy Neesham came back to bounce out Lakshan Sandakan (6) to bring New Zealand back.
Undeterred, Perera smashed four sixes off Southee in the 46th over to reduce the equation 26 off 24. But Boult finally held on to one, running in from long-on as Perera tried to clear the ropes once more while battling back pain, to end an epic innings.
Earlier, Ross Taylor's well-compiled 90, Munro's quick 87 and Neesham's quickfire 67 set-up the game after New Zealand won the toss.
Like Sri Lanka had done in the first ODI, they got an early breakthrough when Martin Guptill, fresh off a century, was dismissed caught behind by Malinga for 13. Captain Williamson departed cheaply as well for 1, caught by Sandakan off Nuwan Pradeep to leave the hosts in a spot of bother at 39/2
Taylor then joined hands with Munro to add 112 runs for the third wicket to revive the innings.
Munro smashed 12 fours and 2 sixes in his 77-ball 87 Munro smashed 12 fours and 2 sixes in his 77-ball 87 Munro was at his usual aggressive self, hitting 12 fours and two sixes in his 77-ball 87 before he was run out, but there was little respite for the Lankans. Henry Nicholls put up another good 57-run stand with Taylor to take New Zealand past 200.
Neesham, who starred with his all-round performance in the first game, continued in the same way, smashing the bowlers all around the park for five fours and three sixes to collect 67 off just 37 balls. It gave the innings the much-needed finish and pushed the score past 300.
Taylor top scored with 90 off 105 balls while Malinga was the most impressive of the Sri Lankan bowlers, finishing with 2/45 from 10 overs.