Neymar scored the winning penalty as hosts Brazil beat Germany 5-4 on penalties in Rio to win their first men's Olympic football gold medal.
The game finished 1-1 after extra time, with Neymar's first-half free-kick cancelled out by Max Meyer's strike.
In the shootout, Germany's Nils Petersen had his penalty saved by Weverton before Neymar won it.
It comes two years after Germany thrashed Brazil 7-1 in the 2014 World Cup semi-finals in Belo Horizonte.
In front of 78,000 at the Maracana, Brazil got a measure of revenge as they finally won the Olympic title after losing in the finals in 1984, 1988 and 2012.