Australia made it two wins from two in the CB Series after successfully defending 231 to defeat Sri Lanka by five runs at the WACA.
Sri Lanka gave themselves a glorious opportunity to record their first ever one-day international victory over Australia at the Perth venue when, after winning the toss, they dismissed the hosts inside their 50-over allocation.
However, once again it was their batting which let them down as Mahela Jayawardene's men crashed from 88-2 to 180-9 to put them on the brink of a second successive defeat in the competition.
There was to be late drama, though, as Angelo Mathews led an inspired fightback, cracking 64 from 76 deliveries and sharing a last-wicket partnership of 46 before holing out in the final over.
Sri Lanka's 10 wickets were shared evenly between five bowlers as only in-form captain Michael Clarke posted a score of any real significance for Australia, making 57 off 88 balls.
Clarke's contribution came after David Warner struck a typically aggressive 34 at the top of order, however the left-hander was unable to build on his flying start.
Warner was one of three Australia wickets to fall inside the opening nine overs as Sri Lanka made a strong start in their quest to bounce back from Wednesday's series-opening defeat to India.
Wicketkeeper Matthew Wade was the first man out, having scored just one run off five balls, when he nicked a Nuwan Kulasekara delivery behind to Kumar Sangakkara.
The hosts had added just four more runs when Ricky Ponting was also out for one, the former captain trapped lbw by Lasith Malinga with a delivery which was just clipping leg stump.
Warner's explosive innings, which included four fours and a six, was finally brought to an end when he was bowled by Mathews for 34 off 29 balls, and when Mike Hussey was caught and bowled by Kulasekara for 23, Australia were teetering on 81-4.
David Hussey and Clarke took Australia to 130 before the former became the fifth man out, caught smartly by Lahiru Thirimanne off Malinga for 27.
Powerful all-rounder Daniel Christian added 33 before falling victim to off-spinner Sachithra Senanayake (2-45), before Mathews took the prize wicket of Clarke, caught at mid-wicket by a diving Jayawardene.
Senanayake took the wicket of Ryan Harris (three) before Dhammika Prasad wiped out the tail by dismissing Mitchell Starc (14) and Clint McKay (25).
Sri Lanka made a strong start in reply, despite losing Upul Tharanga in the fourth over, caught at first slip by Clarke off left-arm seamer Starc.
Tillakaratne Dilshan and Sangakkara added exactly 50 for the second wicket, however a costly mix-up ended their promising stand and sparked a middle-order collapse.
When the ball deflected off Sangakkara's thigh pad, Dilshan called for the run before changing his mind, leaving bowler McKay to swoop on his follow through and throw down the stumps with Sangakkara stranded.
Sangakkara (22) had been going along nicely until that point and was visibly disgusted with his partner as he made his way back to the pavilion.
Dilshan joined him in there soon after when he edged Ryan Harris (1-43) through to Wade when on 40 and Australia moved on top when Jayawardene presented the wicketkeeper with his second catch, steering Christian behind the wicket.
At 110-4 Sri Lanka were still in the hunt, however left-arm spin accounted for two wickets in quick succession to seriously dent their chances.
First, Xavier Doherty (2-24) lured Thirimanne down the pitch and Wade whipped off the bails, then Clarke introduced himself into the attack and trapped the dangerous Dinesh Chandimal (37) lbw with his first delivery.
Mathews, who earlier claimed figures of 2-37, kept Sri Lanka in with a fighting chance as wickets tumbled around him, moving past 50 to leave 18 required for victory off Starc's final over of the match.
After depositing the left-armer through mid-wicket for four and then over long-off for six, Sri Lanka were closing in on a remarkable win. However, Mathews could not finish the job and Christian claimed the match-winning catch.