WELLINGTON - Australia withstood tremendous pressure from South Africa to edge their quarter-final against the Springboks 11-9 in Wellington on Sunday.
James O'Connor kept his nerve to kick the winning points in the 71st minute and book the Wallabies a place in the semi-finals, where they will meet the winner of Sunday night's match between New Zealand and Argentina.
Man of the match, Australia's David Pocock, said: "It was a tough game out there. We knew it was coming, so credit to the Springboks. I think it was a great team effort to get the win and we're stoked to get through to next week.
"The Springboks are so good at building pressure and taking advantage of mistakes."
Pocock's skipper James Horwill, who scored the game's only try, described his team's performance as a "huge effort".
"I am really, really proud with the way the guys fought," Horwill said. "It was a huge effort that took everything we needed."
John Smit, the South Africa captain, said it was sad the way the tournament ended for the reigning world champions. "To go out by two points to penalty kicks was sad. Australia did well under pressure, but I think both teams put it to each other. It was a tough game."
Horwill's try helped Australia take an 8-3 lead into the break, but South Africa had the Wallabies under relentless pressure.
The second half began as the first had finished, with Australia having to do plenty of defending.
The Springboks thought they had scored a try in the 46th minute when Pat Lambie ran in, but referee Bryce Lawrence of New Zealand ruled Jean de Villiers had made a forward pass to Lambie.
Morné Steyn kicked South Africa to within two points with a penalty in the 55th minute. The Springboks were leading the territory and tackling statistics and continually pushing the Australians back.
The pressure was building, but the Springboks never got close enough for a try. Instead, Steyn kicked a trademark drop goal in the 60th minute to give South Africa the 9-8 lead.
Australia somehow continued to quell the storm of the Springbok heavy brigade, led by Schalk Burger, and often turning the ball over against the odds.
Lambie went close with an ambitious drop goal attempt from near halfway in the 68th minute.
In the 71st minute O'Connor put Australia back in the lead with a pinpoint penalty goal after Danie Rossouw hauled Radike Samo over while he was still in the air at a lineout.
The early stages of the match had featured a number of kicks as the two teams jockeyed for dominance.
South Africa gained some momentum from stealing a lineout from Australia's throw and they looked good as they swung the ball to the left along the backline and then back again, with Lambie making a good run before the move broke down.
Australia broke the deadlock from a long touch-finder from Quade Cooper, who had a difficult match, in the 11th minute.
From the lineout, won by South Africa, a maul developed, which Samo flew into. The ball was knocked loose and Pat McCabe was on hand to pass it inside to skipper Horwill, who dived over. O'Connor missed a regulation conversion.
O'Connor made amends with a penalty in the 17th minute after Gurthrö Steenkamp was penalised at a ruck and Australia, looking dangerous, moved into an 8-0 lead.
Steyn attempted a penalty after Stephen Moore was caught offside just inside his own half, but missed the kick.
Play was getting scrappy and in the process star wing Bryan Habana was on the receiving end of at least three bone-crunching tackles, and left the field early in the second spell.
Steyn kicked a penalty after Horwill was penalised for having hands in the ruck to reduce the margin to five points at the break.