After the game ended 1-1 in normal time, Malcom raced onto a diagonal ball from Antony and got the better of Jesus Vallejo before driving the winner into the far corner in the 108th minute to ensure Brazil repeated their Rio 2016 triumph.

“This was the most important goal of my life,” a beaming Malcom told reporters, “It is such a unique moment”.

Dani Alves, Brazil’s 38-year-old captain, who had led the team as an over-age player in a bid to win a major global tournament with his country, collapsed to his knees at the final whistle and buried his face in his hands.

Tokyo 2020 Olympics - Soccer Football - Men - Gold medal match - Brazil v Spain - International Stadium Yokohama, Yokohama, Japan - August 7, 2021. Santos of Brazil punches clear of Nino of Brazil, Diego Carlos of Brazil and Rafa Mir of Spain. Photo: Reuters

Tokyo 2020 Olympics – Soccer Football – Men – Gold medal match – Brazil v Spain – International Stadium Yokohama, Yokohama, Japan – August 7, 2021. Santos of Brazil punches clear of Nino of Brazil, Diego Carlos of Brazil and Rafa Mir of Spain. Photo: Reuters

“My captain Dani, he’s unbelievable, he helps everyone. He lifts us up, He’s unbelievable, I don’t have words for him,” Brazil’s other goalscorer Matheus Cunha said.

The Brazilian players made up for the absence of fans in the 65,000 Yokohama stadium by going through the full repertoire of celebratory songs after the final whistle.

An Olympic gold in football will never match a World Cup title but for 120 minutes there was no doubt that this match meant plenty to both sides.

Brazil were awarded a penalty in the 39th minute when Spain goalkeeper Unai Simon came out to punch clear a cross but crashed into Cunha, only for Richarlison to blast the spot-kick high over the bar.

The South Americans grabbed the lead on the stroke of halftime, however, when a deep Claudinho cross was hooked back across the area by Dani Alves and Cunha brought the ball down to slot home.

Tokyo 2020 Olympics - Soccer Football - Men - Gold medal match - Brazil v Spain - International Stadium Yokohama, Yokohama, Japan - August 7, 2021. Guilherme Arana of Brazil in action with Dani Olmo of Spain. Photo: Reuters

Tokyo 2020 Olympics – Soccer Football – Men – Gold medal match – Brazil v Spain – International Stadium Yokohama, Yokohama, Japan – August 7, 2021. Guilherme Arana of Brazil in action with Dani Olmo of Spain. Photo: Reuters

Spain threatened little but got on level terms in the 61st minute when substitute Carlos Soler broke down the right and whipped a cross to the back post where Mikel Oyarzabal connected with a sweet left-foot volley that whistled past Santos.

With Brazil looking to break on the counter and Spain moving the ball well, the game was tightly balanced in the latter stages but the Spaniards came closest to grabbing a win in normal time.

Oscar Gil’s cross shot from the right caught out Santos and struck the top of the bar in the 86th minute and two minutes later Bryan Gil’s thundering shot from outside the box blasted against the bar.

That meant extra-time and the introduction of Malcom by Brazil coach Andre Jardine, which proved to be crucial as the Zenit St Petersburg winger wrote his name into Brazilian football folklore.