Kusal Mendis hit an unbeaten 69 off 58 balls as Sri Lanka chased down the 155-run target to beat Australia by five wickets in the final match of the series and avoid a 5-0 whitewash at the Melbourne Cricket Ground on Sunday.
Australia take the series 4-1, having won the first game by 20 runs and the second in a Super Over in Sydney after the scores were level at the end of the regulation overs. Australia won the third game by six wickets on Tuesday in Canberra.
The hosts posted a middling 154-6 after opting to bat in Melbourne, but the Sri Lankan batsmen finally found their feet to reach 155/5.
Mendis batted positively, but sensibly, with captain Dasun Shanaka (35) in an 83-run partnership which powered Sri Lanka to their first win against Australia in any format since 2017.
Seamer Kane Richardson took 2-28, but Australia's
second-string bowling attack never looked threatening after conceding 54/2 in the powerplay.
"When we come to the World Cup (in October), we will be really prepared," Shanaka said. "We could have done better in this series."
Reduced to 13/2 after five overs, Australia struggled to build any partnerships of substance as Dushmantha Chameera (2-30) and Lahiru Kumara (2-34) troubled the batsmen with pace.
Aaron Finch's summer, in which the skipper scored 78 runs at a strike rate of 92, ended with a whimper when he was caught on eight.
Matthew Wade struck 43 not out in the back end of the innings to drag his side to a competitive score.
"It (154) probably just wasn't quite enough at the end," Finch said.
"Sri Lanka are a very dangerous side and to win four games in a row was really good."