Brazil won its first Olympic gold medal in men's soccer in dramatic fashion, with Neymar's penalty kick clinching a tense shootout round and sparking celebrations throughout the Maracanã after a 5-4 shootout triumph following a 1-1 draw.
Neymar scored in regulation on a sensational free kick, only to have Max Meyer score an equalizer for Germany. After a scoreless extra period, the sides put on a penalty clinic, with each making its first four kicks. Brazil goalkeeper Weverton saved Nils Petersen's effort, though, setting the stage for Neymar, and the captain delivered.
Brazil's men's soccer team had been to this step before only to stumble and fall, and given the 7-1 events of two summers ago and the amount of emphasis put on winning a first Olympic gold medal, there was more pressure than ever for Brazil to come through.
With a raucous and spirited crowd cheering on the hosts, Germany's Julian Brandt caused a moment of brief panic in the early going. The Bayer Leverkusen winger beat Weverton but put his right-footed attempt from the edge of the box off the crossbar. The moment came on the strike of the 11th minute, which is the point at which Thomas Muller scored the opening goal of 7-1.
Neymar brought those fans back to a celebratory spirit in the 27th minute, curling a beautiful 25-yard free kick off the underside of the crossbar and in to give Brazil a 1-0 lead.
Brandt and Sven Bender nearly scored again for Germany soon after. Brandt had a set piece ball fall to him some 15 yards out, and his half volley was denied by a diving Weverton. Bender's header off a corner kick then hit the bar, marking the third time the Germans hit the woodwork in the opening 36 minutes.
Germany finally found its breakthrough and equalizer from Max Meyer, who was largely unmarked in the center of the box and stroked home a right-footed effort by Weverton off a cross to end Brazil's shutout streak at 509 minutes with the first goal Brazil had conceded all Olympics.
Neither side could threaten much after that, though Neymar and Meyer both put attempts wide of the target, and the two sides headed to extra time.
Brandt had Germany's best chance in the opening period of extra time, putting a right-footed volley just over the bar as the partisan crowd exhaled.
Brazil finally threatened in the extra session in the 106th minute, with Neymar springing Felipe Anderson on goal. Germany goalkeeper Timo Horn came sliding off his line to deny him, though, keeping it level. That was the best chance in the second scoreless 15 minutes, which sent the match to penalties.
Matthias Ginter, Serge Gnabry, Julian Brandt and Niklas Sule made Germany's first four kicks, while Renato Augusto, Marquinhos, Rafinha and Luan matched each one for Brazil. Weverton dove to his left to deny Petersen, and Neymar wrote the final page of a storybook run to the top of the podium.
Brazil joins France as the only nations to win the World Cup, Confederations Cup, senior continental championship, Olympic gold medal, Under-20 World Cup and Under-17 World Cup in men's soccer.
In the bronze medal match, Nigeria held off Honduras 3-2, nearly blowing a 3-0 lead before finishing off the victory. The medal joins Nigeria's gold in 1996 and silver in 2008.