Australia survived an incredible Sri Lankan tail-end effort to continue their winning start to the Commonwealth Bank Series, triumphing in Friday's thrilling game at the WACA Ground by five runs.
The hosts were in total control when Sri Lanka slumped to 6-143 chasing 232 for victory, but all-rounder Angelo Mathews led a spirited fight-back with 64 off 76.
Mathews' heroics left Sri Lanka needing just six runs off the final two balls with one wicket in hand, but he was caught in the deep going for the game-winning shot and Australia survived to improve their record in the tri-series to two from two after bowling out Sri Lanka for 226.
Mitchell Starc's ferocious new ball spell, which saw him take 1-11 off five overs, and Xavier Doherty's match figures of 2-24 off 10 had helped set up the Australian victory.
But the bowlers were punished in the late overs, with Starc finishing with match figures of 2-50 off 9.5 overs and Clint McKay going for 50 runs off his 10 as Mathews, who also took two wickets, almost snatched victory from the jaws of defeat.
In a see-sawing contest, an Australian victory seemed improbable when they were struggling at 8-192 after being sent in to bat, but McKay scored 25 and Starc 14 to help Australia post a competitive score.
Michael Clarke continued his outstanding summer by anchoring Australia's innings with 57 off 88 before taking a wicket with the first ball he bowled to finish with figures of 1-9 off two in a game where several of his captaincy decisions worked out perfectly, although his side struggled to put Sri Lanka away.
Including Tests and one-day internationals, Australia have now won the past six games Clarke has skippered and his team has a perfect two-from-two record in the tri-series.
Earlier, Australia's top order collapsed to see them fall to 2-26 and then 3-50, despite David Warner's quick-fire 34, before Daniel Christian (33) and David Hussey (27) made decent contributions to support Clarke in front of 13,085 fans.
Mathews took 2-37 off nine overs for Sri Lanka and Nuwan Kulasekara took 2-39 off 10, but in similar fashion to their loss to India in Perth on Wednesday, Sri Lanka's batsmen couldn't perform to the same level as their bowlers.
The visitors appeared to be cruising when they were 2-88, but a horrendous mix-up saw Kumar Sangakkara run out for 22 before Tillakaratne Dilshan fell to Ryan Harris (1-43 off 10) for 40 and they later lost 5-65.
Mahela Jayawardene then helped to briefly consolidate until the captain edged to the 'keeper off Christian and after Doherty and Clarke took wickets in quick succession Sri Lanka had lost 3-19.
Even though it seemed all hope had been lost, Mathews and Senanayake frustrated Australia for several overs and, after Lasith Malinga's brief stay, Dhammika Prasad scored 15 from 11 to get Sri Lanka back in the contest.
Sri Lanka required 18 from the final over and a four then a six from Mathews at the start of the over gave them hope, but after back-to-back singles the vice-captain was caught at long on.
After their heartbreaking defeat, Sri Lanka have now won just two of their 17 ODIs at the WACA.