Angelo Mathews and Lasith Malinga scripted an incredible one-wicket victory for Sri Lanka in the first one-day international to extend Australia's losing streak to six matches in all formats.
The tourists looked doomed after slipping to 107-8 in pursuit of a 240 target, including four wickets and a run-out for Australia's debutant spinner Xavier Doherty.
But Mathews and Malinga, with little to lose, threw caution to the wind during a boundary-laden counter-attack.
Both men brought up half-centuries during a stand of 132, the highest ever for the ninth wicket in one-day internationals, that ended in the run-out of Malinga for 56 with the scores level.
Last man Muttiah Muralitharan strode to the middle and hit the winning runs to complete a stunning comeback with 34 balls to spare, Mathews finishing unbeaten on 77.
Sri Lanka's chances had appeared slim after Doherty, an orthodox left-armer from Tasmania, struck three times in his first nine deliveries in international cricket.
The 27-year-old, who had already run-out opener Upul Tharanga with a diving stop and direct hit, removed Mahela Jayawardene (19), Chamara Silva (4) and Kumar Sangakkara (49) to reduce Sri Lanka from a promising 73-2 to 84-5.
Mitchell Johnson (1-68) bowled Thisara Perera for a duck, Suraj Randiv (10) was run-out and Doherty won an lbw decision against Nuwan Kulasekara (0) to move Australia to the brink of victory.
Mathews and Malinga initially appeared content to just have some fun in a hopeless cause, both men showcasing their full repertoire of strokes.
But the runs began to mount and, with the required-rate always under control, it gradually dawned on all concerned that the game was back on.
Australia's stand-in skipper Michael Clarke, leading the side as Ricky Ponting was attending his grandmother's funeral, was soon looking short of ideas.
Mathews brought up his half-century from 61 deliveries, while Malinga hammered six fours and two sixes in a 48-ball effort of 56, obliterating his previous one-day best of 16.
With 15 still required, Shane Watson's medium pace was dispatched for a couple of boundaries in a 43rd over that accounted for 12 of the requirement.
A pair of singles at the start of the next over, which part-time spinner Clarke chose to bowl himself, brought the scores level.
But there was a further twist, Malinga run out going for the winning single by Steven Smith's direct hit.
Mathews could not pierce the in-field from the final two balls of Clarke's over, leaving Muralitharan on strike to Watson (0-39).
The veteran spinner, very much a number 11 batsman, blocked once before Watson strayed onto leg-stump and he was able to find the boundary at fine-leg to end the drama.
Seam bowler Perera had earlier claimed 5-46 to help restrict Australia to 239-8 after they had opted to bat first.
Brad Haddin (49) and Clarke (27) shared a 55-run stand for the second wicket to leave the hosts with a solid platform at 85-1 in the 17th over.
But that became 88-4 as Perera removed both in quick succession and bowled Cameron White for a golden duck.
Michael Hussey and Shaun Marsh stopped the rot with a 67-run, fifth-wicket partnership but the run-rate remained becalmed throughout the remainder of the innings.
Hussey, who came into the match with question marks over his form, finished with 71 not out from 91 balls but hit just one four, while Marsh contributed a boundary-less 31 before being caught behind attempting to cut off-spinner Randiv (1-35).
Australia, without a win since the first Test against Pakistan at Lord's in July, have only two more games to turn their form around before the start of the Ashes in Brisbane on November 25.
The second one-dayer against Sri Lanka takes place in Sydney on Friday before the series concludes in Brisbane on Sunday.