Thisara Perera was the difference with the bat and then held his nerve, although only barely, with the ball to seal a two-run victory off the final delivery of a rain-reduced chase.
It became that kind of night when rain interrupted Australia's chase of 162 and despite the shower being short, the umpires did not allow play to restart for 45 minutes due to difficulties drying the outfield.
When the rain arrived after 10 overs, Australia were 15 runs behind on the Duckworth-Lewis score at 2 for 60.
By the time play resumed Australia needed a further 62 runs from five overs
With Shaun Marsh and George Bailey well set and eight wickets in hand, the new target of 122 from 15 overs gave Australia hope of pulling off victory.
In a heated finale, Glenn Maxwell needed four runs from the last ball for victory and was frustrated by a long conference held by several Sri Lankan players before the delivery was bowled, and when Perera sent down the ball wide of off Maxwell missed and all the batsmen could manage was a bye.