Rayan scored a 95th-minute equaliser to spare Brazil‘s blushes as they drew 1-1 with Australia.
Carlo Ancelotti’s Brazil were aiming to find form again after exiting the World Cup in the last 16 with defeat to Norway.
But they were underwhelming in Townsville, and looked set to come unstuck when Nestory Irankunda found the top-left corner with a sublime free-kick in the 68th minute.
Yet there was a sting in the tail as Brazil levelled with their final attack as teenager Rayan headed home to deny the Socceroos only their second win over the five-time world champions.
Irankunda had tried his luck from long range in the seventh minute but found Hugo Souza equal to his effort.
Brazil dominated thereafter and Bruno Guimaraes spurned a presentable chance when he fired over the crossbar, and it was an infraction from the Arsenal midfielder that denied Ancelotti’s men the opening goal in first-half stoppage time.
After Australia went close to going ahead through Harry Souttar following a corner, the visitors appeared to have broken the deadlock as Chelsea winger Estevao fired into the bottom-left corner.
However, the goal was chalked off following a VAR review as Guimaraes was deemed to have fouled Souttar in the build-up.
Raphinha whistled an effort narrowly wide as Brazil pushed for the opener, but five minutes after that chance it was Irankunda who found it for Australia as his curling strike left Souza with no chance.
Brazil pressed to find a response and, just as it looked as if Australia had survived as the four allocated minutes of injury time passed without a leveller, Bournemouth forward Rayan rose to meet Raphinha’s corner with a header that proved too strong for Patrick Beach and went in off the crossbar.