New Zealand snatched a last-gasp victory over Australia through Jordie Barrett's injury-time try in a highly controversial finish to the Bledisloe Cup clash in Melbourne.

Leading 37-34, the Wallabies won a penalty under their own posts with seconds to go only for fly-half Bernard Foley to be warned by Matthieu Raynal for time wasting in taking his kick.

When Foley continued to delay, despite being urged by Raynal, the French official awarded a free-kick to New Zealand and from the ensuing scrum Barrett pounced in the 82nd minute.

The law states that a "penalty or free-kick must be taken without delay" but it is rare to see it enforced in decisive circumstances.

Australia fought back from deficits of 10-0 and 31-13 only for Foley's blunder to give the All Blacks a sniff of their line which they took to claim top spot in the Rugby Championship.