Brazil celebrates its second consecutive gold medal. (Kareem Elgazzar-USA TODAY Sports)

It took the Brazilian men 64 years to secure its first Olympic soccer gold medal.

They didn’t have to wait as long for No. 2.

Malcom scored the game-winner in the 108th minute to lift the South American side to a 2-1 victory over Spain at Nissan Stadium in Yokohama, Japan Saturday.

He received a pass from Antony, faced into the penalty area and fired a shot that deflected off goalkeeper Unai Simon that traveled into the net.

The Brazilians, who became the first team to defend its Olympic soccer title, won at the same stadium their national did against Germany in the 2002 World Cup final.

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

Cunha’s tallied in the 45th minute off a Dani Alves assist after Richarlison’s missed penalty kick in the 38th minute for a 1-0 Brazilian lead at halftime.

The Spaniards tied it in the 61st minute when Mikel Oyarzabal volleyed in from Carlos Soler’s cross.

The European squad hit the crossbar twice late in regulation, by Oscar Gil and Bryan Gil.