The All Blacks scored a last-minute converted try to give the world champions a dramatic 29-28 victory over Australia in the third and final Bledisloe Cup test in Brisbane.
The Wallabies looked destined to emerge from two weeks of turmoil over the Kurtley Beale saga with a famous victory until midfielder Malakai Fekitoa crossed for New Zealand's fourth try, which replacement first-five Colin Slade calmly converted.
Winger Cory Jane and hooker Dane Coles scored for the visitors in the first half and halfback Aaron Smith's 69th minute try kept the All Blacks in a game they had been chasing all night.
Tries from halfback Nick Phipps and first-five Bernard Foley in the first half and one after the break from winger Adam Ashley-Cooper, playing in his 100 test, were Australia's reward for a performance of rare intensity but ultimately it was not enough.
The Bledisloe Cup was already lost for another year but this could have been a win the Wallabies would have cherished after defeats to South Africa and Argentina in their last two outings and the row which could see Beale kicked out of Australian rugby next week.
In the first of their last four home tests played in dry conditions, they kept the ball in hand as they ran at the All Blacks all night in front of a crowd of 45,186.
The All Blacks were also coming off a loss after their defeat at the hands of the Springboks in Johannesburg two weeks ago and were determined to avoid losing two tests in a row for the first time since 2011.
The game started at a frenetic pace with the home side needing some brilliant defence from centre Tevita Kuridrani and flanker Scott Fardy to keep the world champions from opening the score in the first 10 minutes.
The Wallabies were also looking to run the ball, though, and Christian Lealiifano found a gap for a 30 metre break up the centre in the 12th minute and a couple of phases later Phipps went over from close range.
Foley converted but the All Blacks counter-punch took a matter of seconds, centre Conrad Smith claiming the re-start and starting a move which led to number eight Kieran Read putting Jane over in the corner.
Captain Michael Hooper handed the ball to Foley after 32 minutes to give the Wallabies a 10-7 lead with his first penalty but again the All Blacks hit straight back.
Australia appeared to have their defence in place as the ball swept down the New Zealand backline but hooker Coles dummied twice and charged through a huge gap to touch down.
Beauden Barrett missed an easy conversion and this time it was Australia with an immediate response, Foley pouncing from close range to dot down in the corner and give his side a 15-12 halftime lead.
Three minutes after the break and they had extended the lead to 22-12 with a converted try from winger Adam Ashley-Cooper -- his 29th for Australia as he became the sixth Wallaby to win 100 caps.
The Wallabies had made their way to the All Blacks line in five and 10-metre bursts before Ashley-Cooper cut inside his marker to touch down in the right-hand corner.
Barrett cut the deficit to seven points with a penalty after 54 minutes but Foley kicked his second four minutes later and from the ensuing re-start All Blacks replacement Patrick Tuipulotu was sin-binned for tackling Rob Simmons in the air.
It was the All Blacks who got the next try, Smith getting his reward for a quickly taken penalty close to the home try line to reduce the lead to 25-22.
Replacement halfback Nic White had the crowd on their feet when he extended it by another three points three minutes from time but you write New Zealand off at your peril and the All Blacks pounded away until Fekitoa found a gap to snatch victory from the jaws of defeat.