Australia will play England in a "blockbuster" World Cup semi-final after the holders suffered a dramatic 10-run defeat against South Africa at Old Trafford on Saturday.
David Warner marked his first match against South Africa since a 12-month ball-tampering ban with his third hundred of the World Cup, but it was not enough to prevent Australia suffering their second loss of the 10-team group stage.
Defeat on the penultimate ball meant Australia, who had already qualified for the semi-finals, failed to clinch top spot as India leapfrogged them to take pole position after beating Sri Lanka earlier on Saturday.
"It is a little frustrating. Davey Warner made a magnificent hundred and Alex Carey played a brilliant knock to get us close, but it was not quite good enough," Australia captain Aaron Finch said.
Had Australia won, they would have faced fourth-placed New Zealand in the first semi-final at Old Trafford on Tuesday.
But instead they will play resurgent hosts England in the second semi-final at Edgbaston on Thursday.
"It's going to be a blockbuster. It doesn't get much bigger than Australia v England in the World Cup semi-finals," said Finch, whose side beat England by 64 runs in the group stage.
Finch revealed batsman Usman Khawaja, who retired hurt before returning late in the match, could be ruled out for the rest of the tournament.
"It doesn't look ideal for Usman. He will have a scan in the morning," Finch said.
"The whole Australia A team is here if they need to be replaced. I imagine Usman will."
Warner (122) and Alex Carey (85) got Australia to within sight of a stiff target of 326 during a fifth-wicket partnership of 108.
But neither could see their side home to victory after South Africa captain Faf du Plessis made 100 and Rassie van der Dussen a career-best 95 in a total of 325-6.
"What a game. It is always a pleasure to play Australia and it was a nice close game. We wanted to go home with at least a small smile," Du Plessis said.
Australia were struggling at 119 for four and Warner could only watch as wickets fell early against a Proteas side whose own semi-final hopes had long since disappeared
Finch, Warner's opening partner, went for three, when he chipped Imran Tahir to short cover, sparking a typically exuberant celebration from the bowler.
Steve Smith fell lbw for seven to Dwaine Pretorius.
But Warner held firm, going past 600 runs for the tournament, with his latest century coming up in 100 balls when he edged Chris Morris for his 12th four.
He was eventually out when a drive off Dwaine Pretorius was well caught by a diving Morris at mid-on.
Carey, however, launched Tahir for six during his career-best ODI knock before his 69-ball innings ended when he carved Morris to Aiden Markram at deep cover.
Khawaja helped get the target down to 25 off 12 balls before he was bowled for 18 by Kagiso Rabada.
The target eventually became 18 off a nail-biting last over -- bowled by Andile Phehlukwayo -- with one wicket standing.
And with 11 needed off two balls, last man Nathan Lyon holed out to Markram in the deep.
Earlier, Mitchell Starc equalled Australia legend Glenn McGrath's World Cup tournament record of 26 wickets, set at the 2007 event in the Caribbean, with a return of 2-59.
Markram (33), opening after South Africa veteran Hashim Amla was ruled out with a knee injury playing football in a warm-up on Friday, and Quinton de Kock (52) set the tone in front of a sun-drenched crowd in a first-wicket stand of 79.
Du Plessis, who drove fast bowler Pat Cummins for a superb six, completed the first hundred by a South African at this World Cup in 93 balls.
Van der Dussen fell short of his maiden ODI hundred when, trying to hit the last ball of the innings for six, he holed out off Cummins.