The Springboks had established a 9-8 lead through the boot of Morne Steyn, having laid siege to Australia’s line for half-an-hour, only for Victor Matfield to concede a penalty in the 71st minute.
And O’Connor stepped up and nervelessly sent his kick between the uprights as the Wallabies made it six victories in seven matches against their Tri Nations rivals.
South Africa coach Peter de Villiers looks set to quit his job following the defeat. He gave the strongest possible indication that his four-year reign is at an end after South Africa relinquished the world title they won in Paris four years ago.
The Springboks’ 2007 World Cup-winning captain John Smit, meanwhile, has bowed out of the Test arena as he prepares to join Aviva Premiership champions Saracens, with his fellow cap centurion — lock Victor Matfield — also heading into international retirement.
Asked if the loss would mark the end of his career, De Villiers said: “I think so. It was a brilliant journey, something that none of you guys can take away from me. There is a time to come and a time to go, so I think the journey for me is over.
“I wanted to be the best me that I could be. The way that I am is the way that I want to be remembered.”
Smit paid tribute to De Villiers, adding: “As much as the pain flows through the heart right now, the other thing that was said in the changing room by many a guy was that we have had a great four years together and that has been pioneered by Peter. He’s not the usual mould of coach that any of us have been used to but he is one that we have thoroughly enjoyed over the four years.
“His saying from the day he started and, I suppose when he wakes up tomorrow, is that even the bad days are good. He has made us enjoy every moment. He has been a great man.”
The Springboks were left to rue several missed opportunities, while they never got to grips with New Zealand referee Bryce Lawrence’s interpretation at the breakdown, where Wallabies openside flanker David Pocock dominated.
“Quarter-finals, semi-finals, finals, you have got to take your chances. It didn’t go our way, we didn’t take all our chances,” De Villiers said.
“The guys are quiet. We never expected this, so it was not a really good mood in the changing room.”
Assessing his seven years as Springboks captain, Smit said: “It is a sad occasion. You never prepare for how it ends because you want it to be a fairytale, you want it to be a final, but it hasn’t worked out that way.
“It would be silly to take that seven years and judge it by what happened today. I have been blessed to be in charge of these guys and run out with them, and blessed to be captain of the Springboks.
“I am devastated today. It is the end of a chapter and I am proud of the guys I have played with and really proud to have been a Springbok.”
Australia coach Robbie Deans hailed Pocock’s display, which secured a semi-final clash against Deans’ native New Zealand in Auckland next Sunday.
“He was immense,” Deans said. “David Pocock’s game was remarkable, and it was bigger than he got credit for.
“The world is blessed with some very good snafflers at the moment, and no doubt people will be looking forward to next week, to that end. What you saw out there was the most experienced World Cup side in the world [South Africa] really turn the screws on the youngest. So, our boys came of age in terms of the way they accepted that challenge and stood up to it.”
AUSTRALIA: K Beale, J O’Connor, A Ashley-Cooper, P McCabe, D Ioane, Q Cooper, W Genia, S Kepu, S Moore, B Alexander, D Vickerman, J Horwill, R Elsom, D Pocock, R Samo.
Replacements: A Faingaa for Beale (75), B Barnes for McCabe (52), J Slipper for Kepu (69), T Polota-Nau for Moore (63), N Sharpe for Vickerman (54), B McCalman for Samo (72).
SOUTH AFRICA: P Lambie, JP Pietersen, J Fourie, J de Villiers, B Habana, M Steyn, F du Preez, G Steenkamp, J Smit, J du Plessis, D Rossouw, V Matfield, H Brussow, S Burger, P Spies.
Replacements: F Hougaard for Habana (49), B du Plessis for Smit (49), F Louw for Brussow (20), W Alberts for Burger (14).
Referee: Bryce Lawrence (New Zealand).