Australia missed the chance to top the Cricket World Cup group standings after losing to South Africa and they'll now play England in the semi-finals.
South Africa win by 10 runs
South Africa 325/6: Faf du Plessis 100, Rassie van der Dussen 95, Quinton de Kock 52; Nathan Lyon 2-53, Mitchell Starc 2-59
Australia 315: David Warner 122, David Carey 85; Kagiso Rabada 3-56, Dwaine Pretorius 2-27, Andile Phehlukwayo 2-22
Australia will face England in a blockbuster World Cup semi-final showdown as the defending champions finished second in the group after an agonising loss to South Africa.
India's win over Sri Lanka meant Australia were leapfrogged in the standings, shortly after Faf Du Plessis' 93-ball century and Rassie Van Der Dussen's one-day international best of 95 had propelled the Proteas to 325 for six.
Despite David Warner's 122, a defiant innings as he and Steve Smith faced South Africa for the first time since the ball-tampering scandal, Australia lost by just 10 runs as they were all out for 315 after 49.5 overs.
At 119 for four a heavy defeat loomed, but Warner's sensational ton and Alex Carey's 85 from 69 balls helped to bring the equation down to 11 from the final two balls at Old Trafford, only for Nathan Lyon to hole out.
That confirmed India as group winners and they will take on New Zealand while Australia are up against the tournament hosts with fitness doubts over Usman Khawaja and Marcus Stoinis.
Mitchell Starc was wayward against the homeward-bound South Africa, coughing up 14 runs in his first over, but finished with two for 59, taking him to 26 wickets for the tournament and equalling compatriot Glenn McGrath's all-time record.
Starc's struggles after South Africa won the toss led to Quinton De Kock and Aiden Markram, opening in place of the injured Hashim Amla, making a blistering start in a 79-run stand.
Both unleashed a series of sumptuous off-side drives, but Markram was stumped on 34 after overbalancing to Lyon, who also snared Quinton De Kock for 52 after an attempted slog ballooned to Starc at short third man.
Van Der Dussen was struck on the helmet by Pat Cummins and was then given a reprieve on four when Carey missed a stumping. It was a rare moment of aggression from the South African in a guarded start.
Du Plessis was doing the bulk of scoring early on and shortly after passing a half-century, he came down the track and clubbed Cummins over his head for six before crunching through the covers for four.
Van Der Dussen, on 24 from 46 balls, accelerated thereafter, planting Maxwell down the ground for six en route to a 69-ball fifty - the seventh time in 14 ODIs he has gone to a half-century.
Du Plessis moved into three figures - South Africa's first century of the tournament - before departing off the very next ball, miscuing Jason Behrendorff to Starc at short third man, ending a 151-run stand with Van Der Dussen.
Starc removed JP Duminy and Dwaine Pretorius while Van Der Dussen was denied a first international century after holing out to Glenn Maxwell at deep midwicket from the last ball of the innings.
Australia were faltering when Aaron Finch drove Imran Tahir to short cover while Khawaja retired hurt because of a problem to his left hamstring, with Smith - jeered on his arrival to the crease - trapped lbw by Pretorius.
De Kock's flick on to the stumps accounted for Stoinis, who also seemed to be struggling with injury, while the South Africa wicketkeeper took a leaping catch after Maxwell had feathered an attempted pull off Kagiso Rabada.
Warner, who should have been run out on nought but survived because Rabada threw to the wrong end, had contributed 67 from a score of 119 for four.
The left-hander gave the business to anything short, pulling Rabada and Chris Morris over deep midwicket for sixes, and he found a willing ally in Carey, dropped on 28 after Imran Tahir spilled a return catch.
Warner went to a run-a-ball hundred with an outside edge for his 12th four while he and Carey took 16 runs from Tabraiz Shamsi in the 37th over.
However, after Carey had gone past a 47-ball fifty, Warner shovelled Pretorius to wide mid-on where Morris took a blinder of a leaping catch, ending a 108-run stand.
Once Carey had departed, slicing to Markram at cover point off Morris, Khawaja came back out and he and Starc took 17 runs from the 48th over but were both bowled by Rabada shortly afterwards.
Lyon then slugged to deep midwicket off the penultimate delivery to end a thriller as South Africa clinched an eighth win over Australia in their last nine ODIs.
- July 9 - India v New Zealand, Old Trafford, 1030 BST
- July 11 - Australia v England, Edgbaston, 1030 BST
- July 14 - Final, Lord's, 1030 BST
Played | Won | Lost | No Result | Tied | Net Run Rate | Points
- India P 9 W 7 L 1 N/R 1 T 0 NRR +0.809 Pts 15
- Australia P 9 W 7 L 2 N/R 0 T 0 NRR +0.868 Pts 14
- England P 9 W 6 L 3 N/R 0 T 0 NRR +1.152 Pts 12
- New Zealand P 9 W 5 L 3 N/R 1 T 0 NRR +0.175 Pts 11
- Pakistan P 9 W 5 L 3 N/R 1 T 0 NRR -0.430 Pts 11
- Sri Lanka P 9 W 3 L 4 N/R 2 T 0 NRR -0.919 Pts 8
- South Africa P 9 W 3 L 5 N/R 1 T 0 NRR -0.030 Pts 7
- Bangladesh P 9 W 3 L 5 N/R 1 T 0 NRR -0.410 Pts 7
- West Indies P 9 W 2 L 6 N/R 1 T 0 NRR -0.225 Pts 5
- Afghanistan P 9 W 0 L 9 N/R 0 T 0 NRR -1.322 Pts 0