Australia were denied a famous victory over Brazil after the five-time world champions scored in stoppage time to secure a 1-1 draw in their international friendly in Townsville on Friday.
Nestory Irankunda had put Australia ahead in the 68th minute with a superb free-kick, sending the home crowd into celebration after the Socceroos had frustrated Brazil for much of the encounter.
However, Brazil responded in the final minute of the match when substitute Rayan rose to head home the equaliser with virtually the last touch of the game.
Australia had thought they were trailing earlier in the match after Chelsea forward Estêvão found the net for Brazil, but the goal was ruled out following a VAR review.
The video assistant referee determined that Bruno Guimarães had fouled Australia defender Harry Souttar in the build-up, ensuring the hosts went into the second half level.
Irankunda then broke the deadlock after Douglas Luiz brought down youngster Paul Okon-Engstler, curling the resulting free-kick beyond Brazil goalkeeper Hugo Souza in the 68th minute.
The 20-year-old celebrated his stunning strike with a backflip in front of a sold-out crowd as Australia moved within sight of only their second victory over Brazil in 12 meetings.
Brazil, coached by Carlo Ancelotti, struggled to impose themselves consistently with a revamped squad, having retained only nine players from their World Cup team.
Australia will now face Brazil again at Suncorp Stadium in Brisbane on Tuesday, with the Socceroos seeking their second victory in 12 meetings against the South Americans.