A stumbling Hasaranga took four wickets after brilliant innings, but it was all in vain.
Australia won by two wickets (D/L method) with 282 for 8 (Maxwell 80, Smith 53, Hasaranga 4-58) over Sri Lanka 300 for 7 (Mendis 86, Nissanka 56, Gunathilaka 55).
Sri Lanka put up a commanding score, took early wickets, were solid through the middle, and looked like they would defend the rain-adjusted 282 off 44 overs for much of the chase.
Glenn Maxwell, however, pulled the rug out from under them with an 80 not out off 51.
With Australia needing 93 off 84 balls and five wickets remaining, he immediately assumed the role of aggressor on a Pallekele surface with significant turn.
He clearly enjoys this venue, as he hit a 49-ball T20I century here in 2016.
However, this inning was more methodical.
He waited for length errors and used the reverse sweep effectively to keep Australia’s requirement at around a run-a-ball.
He trusted the lower order to a point, but he was also skilled at farming the strike as the game approached its conclusion.
In the ninth-wicket stand with Jhye Richardson, he faced 15 of the 18 balls.
When he got balls in his area, he hit sixes off Dushmantha Chameera to win the match with nine balls to spare.
Wanindu Hasaranga, who was limping for much of the game, took four wickets to keep Sri Lanka in contention.
Dunith Wellalage, a debutant left-arm spinner, also took two wickets, including Steven Smith.
But Maxwell pounced on both, hitting 20 off 12 against Hasaranga and 18 off 10 against Wellalage.
That is, in essence, where he won the match.
Maxwell ruled the legside.
With the exception of one, all of his six sixes came in the arc between backward square leg and wide long-on.
Only once did he appear slightly uneasy, and that was against the pace of Chameera, whom he had walloped for three sixes by the end.
Earlier in Australia’s chase, Smith had hit 53 off 60 balls, Finch had 44 off 41 balls, and Marcus Stoinis had 44 off 31 balls, including four fours and two sixes, following a long rain break.
The highest partnership in all of this was the 67-run stand between Finch and Smith, and there was only one other fifty-plus stand.
Sri Lanka continued to take wickets, but never in large numbers.
Finch, Smith, Stoinis, Maxwell, and even Marnus Labuschagne and Alex Carey – who both scored in the 20s – kept Australia in the game and, more importantly, puttered along at a good run rate.
Rain fell when Australia was 72 for 2 in the 13th over, cutting the chase by six overs.
Perhaps Australia benefited from the slightly slick ball and deliveries skidding onto the bat.
But there was rarely a moment when their batters did not appear composed.
The target was 301 off 50 overs when they began the chase, and Sri Lanka had posted a score of 300 for 7 thanks to their openers, who put on 115, and Kusal Mendis, who hit 86 not out off 87.
Pathum Nissanka hit 56 off 68 and Danushka Gunathilaka hit 55 off 53 for Sri Lanka, who surged through the first 19 overs before their wickets fell in quick succession.
Mendis, on the other hand, massaged them through that period with a lot of help from Charith Asalanka, with whom he shared a 77-run stand.
Sri Lanka appeared to be on track for a score of around 280 off 50 overs, which seemed pretty good on a slow track, until Hasaranga smashed five consecutive fours off Jhye Richardson in the 49th over, putting Sri Lanka in the vicinity of 300. Hasaranga scored 37 off 19 balls.
At the time, it appeared that Sri Lanka had a great chance of defending this total because they had three frontline spinners in their XI, and Australia’s best bowler had been Ashton Agar, who had taken 2 for 49 from his 10 overs.
These predictions, however, clearly did not take Maxwell into account. Sri Lanka will feel as if they should have won. Maxwell’s hitting was almost too good.