Sri Lanka held their nerve to dismiss Australia for 229 with five balls remaining in reply to their total of 238 [GETTY]
Lasith Malinga sparked a top-order collapse as Sri Lanka claimed a thrilling nine-run win over Australia to book their place in the limited-overs tri-series finals.
David Hussey hit 74 runs off 74 balls in a last gasp attempt to salvage a win for Australia, but was dismissed in the first ball of the final over.
Sri Lanka needed a win on Friday in front of a large crowd of supporters at the Melbourne Cricket Ground to advance to the finals against Australia. A loss would have seen India go through.
"We lifted our game,'' Sri Lanka captain Mahela Jayawardene said.
"I'm sure the crowd will follow us now, the lift that we got (from them), it pushed us in the last few overs.''
Malinga (4-49) claimed the important wickets of David Warner, Peter Forrest and Shane Watson to help Sri Lanka defend their innings of 238.
Australia's Dan Christian earlier claimed a hat trick among his five dismissals, but half centuries from Kumar Sangakkara, Dinesh Chandimal and Lahiru Thirimanne proved enough to guide Sri Lanka to a winning total.
Australia made an assured - albeit short lived - start to their run chase as Warner made 6 from six balls before being dismissed by Malinga in the third over.
Fellow-opener Matthew Wade was out two balls later after making 9 off 12 balls when he was trapped lbw by Nuwan Kulasekara.
The collapse continued as Forrest was caught behind for 2 off Malinga in the next over, leaving Australia at 26-3.
Shane Watson set about restoring Australia's impetus, sharing 87 runs with Mike Hussey until Hussey was caught behind for 29 off Thirimanne.
Watson made 65 off 83 balls before he was bowled middle stump by Malinga and Christian was caught and bowled by Sachithra Senanayake for 3.
James Pattinson, who returned from injury to play his first ODI of the series, was caught by Tillekeratne Dilshan at mid-wicket for 12 off Rangana Herath and Australia's hopes looked to be fading when Clint McKay was run out for 6 two overs later.
Sri Lanka innings
M Jayawardene run out 5
T Dilshan c Wade b Pattinson 9
K Sangakkara c Forrest b Pattinson 64
D Chandimal c Mckay b Pattinson 75
L Thirimanne b Pattinson 51
A Mathews c Doherty b Christian 5
T Perera c M Hussey b Christian 5
S Senanayake lbw Christian 0
N Kulasekara lbw Christian 0
R Herath not out 14
L Malinga b Christian 2
Total (all out, 50 overs) 238
Fall of wickets: 1-10 2-17 3-140 4-186 5-195 6-206 7-206 8-206 9-235
M Wade lbw Kulasekara 9
D Warner c Perera b Malinga 6
S Watson b Malinga 65
P Forrest c Sangakkara b Malinga 2
M Hussey c Sangakkara b Thirimanne 29
D Hussey c Dilshan b Kulasekara 74
D Christian c & b Senanayake 3
J Pattinson c Dilshan b Herath 12
C McKay run out 6
X Doherty c Dilshan b Malinga 7
B Hilfenhaus not out 0
Total (all out, 49,.1 overs) 229
Fall of wickets: 1-16 2-18 3-26 4-113 5-140 6-151 7-178, 8-187 9-226
David Hussey hit a big six into the stands in the 48th over to leave Australia needing 17 runs off 17 balls, but Xavier Doherty popped a catch to Dilshan off Malinga in the next over to leave the target at 13 runs off 10 balls.
"A brilliant game of cricket,'' Watson said.
"You never knew who was going to win. Dave Hussey batted beautifully, as he's shown through the summer so far.''
Allrounder Christian earlier had figures of 5-51, while paceman Pattinson took 4-51 as Sri Lankan opening pair Jayawardene and Tillekeratne Dilshan got the tourists off to a poor start after Jayawardene won the toss and elected to bat.
Jayawardene (5) was run out in the second over, as he attempted a risky single and was beaten by a David Hussey direct hit.
Pattinson claimed his first wicket a short time later when he had Dilshan (9) caught behind.
Sangakkara and Chandimal then combined to steady the innings, while building up the run rate with a 123-run third-wicket partnership.
Sangakkara was eventually caught at deep square leg by Forrest off Pattinson for 64 and Chandimal became Pattinson's third victim when he was caught by Clint McKay at mid-off. His 75 came off 84 balls with three fours and a six.
Dan Christian removed Angelo Mathews for 5 when Doherty claimed an athletic running catch near the mid-on boundary.
Perera (5) was caught off a Christian ball two overs later on the deep mid-wicket boundary by Michael Hussey, who grabbed the ball, threw it into play and re-caught it to save six runs.
Christian struck again with the next ball to trap Senanayake lbw for a duck and completed the hat trick when he dismissed Kulasekara in similar fashion without scoring.
Thirimanne was out for 51 in the 49th over when he played a Pattinson ball onto his stumps, and Christian completed his five-wicket haul by bowling Malinga for 2 with the last ball of the innings.