Australia (12) 18
Pens: Giteau 6
New Zealand (3) 19
Try Nonu Con: Carter Pens: Carter 4
Carter's influence helped guide the All Blacks to victory
Fly-half Dan Carter marked his return to New Zealand's side with a 78th-minute match-winning penalty to beat Australia in the Tri-Nations in Sydney.
He had been out of action since suffering an Achilles injury in January while playing in club rugby in France.
His side upped their game in the second half after trailing 12-3 at the break.
Ma'a Nonu's try helped secure a 16-15 lead before Matt Giteau's sixth penalty edged the Wallabies ahead, but Carter stepped up to secure the Bledisloe Cup.
The win means the All Blacks keep alive their Tri-Nations hopes while Australia's defeat, their third in a row and fifth straight loss to New Zealand, leaves the Wallabies languishing at the bottom of the table.
Australia had led for almost all of the contest after Giteau produced a strong display of goal-kicking.
The Wallabies looked to be in control at the break but failed to contain the All Blacks in the second half.
And All Blacks coach Graham Henry paid tribute to his side's mental toughness after their late victory.
"I was just very proud of the character shown by the players," said Henry.
"It was just mental toughness, because we didn't get the roll of the dice.
"The Australians are a very good side and they really stretched us and there was just a feeling of pride after the game for what the guys achieved.
"Our guys showed a huge amount of intestinal fortitude. It just shows the guys have got the guts to hang in and keep going."
New Zealand opened the scoring in the fourth minute with a Carter penalty but the Australians drew level four minutes later when Giteau landed his first shot at goal.
Giteau put the Wallabies ahead with a second penalty after 10 minutes and then slotted a third on the half-hour and a fourth on the break when scrum-half Jimmy Cowan pulled off a try-saving tackle on Australia lock Nathan Sharpe.
The most obvious difference is experience. They're masters at getting home and we're working hard at acquiring that art
Australia coach Robbie Deans
The match burst into life in the second half when Wallabies number eight Richard Brown was sin-binned for a dangerous tackle on prop Owen Franks.
Carter and Giteau traded penalties before the All Blacks had two tries disallowed, the first by Carter because of a forward pass and the second by Cowan for obstruction.
But the All Blacks' persistence finally paid off when Nonu combined with wing Sitiveni Sivivatu to score in the left corner and Carter landed the difficult conversion.
Australia regained the lead immediately when Giteau slotted his sixth penalty but when Wallabies winger Lachie Turner was penalised for failing to release the ball, it gave Carter the chance to seal the win.
Following their defeat, Australia coach Robbie Deans said his side only had themselves to blame for not securing victory.
"It (victory) was there for us but we were just not quite there, we had a great opportunity but we came up short," said Deans.
"The most obvious difference is experience. They're masters at getting home and we're working hard at acquiring that art.
"We're making headway but we haven't acquired it yet."
The Wallabies take on South Africa at home in the next two matches of the competition.
New Zealand, who trail the Springboks by just four points with two home games remaining, are next in action when they clash on 12 September.
Australia: James O'Connor; Lachie Turner, Adam Ashley-Cooper, Berrick Barnes, Drew Mitchell, Matt Giteau, Luke Burgess; Benn Robinson, Stephen Moore, Al Baxter, James Horwill, Nathan Sharpe, Rocky Elsom, George Smith (capt), Richard Brown.
Replacements: Tatafu Polota-Nau, Ben Alexander, Dean Mumm, David Pocock, Will Genia, Ryan Cross, Peter Hynes.
New Zealand: Mils Muliaina; Joe Rokocoko, Conrad Smith, Luke McAlister, Sitiveni Sivivatu; Dan Carter, Jimmy Cowan; Tony Woodcock, Andrew Hore, Owen Franks, Brad Thorn, Isaac Ross, Jerome Kaino, Richie McCaw (capt), Kieran Read.
Replacements: Aled de Malmanche, John Afoa, Jason Eaton, Rodney So'oialo, Brendon Leonard, Stephen Donald, Ma'a Nonu.
Referee: J Kaplan (South Africa)