to hand Brazil Olympic gold in the Maracana
Neymar stepped up to score the winning penalty to give Brazil gold in the Olympic final
Nils Petersen saw his spot-kick saved with everyone else holding their nerve prior to his miss
Neymar earlier curled home an excellent free-kick into the top corner to open the scoring
Max Meyer swept the ball into the bottom corner after collecting on the edge of the box to level
The world's fastest man Usain Bolt was in attendance to watch the game at the Maracana
Neymar inspired Brazil to redemption, revenge and glory, helping atone for the most humiliating night in the country's footballing history by defeating nemesis Germany on penalties to finally win Olympic gold.
The wounds remain raw two years on from a 7-1 World Cup semi-final shellacking that not only saw the Selecao lose the chance of winning on home turf but their dignity.
Saturday's gold medal match offered a shot at redemption and proved the defining moment of the hosts' Games, with Neymar, ruled out of 2014's meeting through injury, scoring the decisive penalty as Germany were overcome 5-4 in the shootout that followed an intense 1-1 draw at the magnificent Maracana.
The victorious Brazilian players show off their gold medals after they overcame a stubborn Germany on penalties
Neymar walks on the pitch with his young son who holds his father's gold medal in his hands
Goalkeeper Weverton races towards Neymar who sinks to his knees after he won the gold medal for Brazil
A range of emotions across the face of the Brazil side as they stand and sing their national anthem
With this effort the Brazil captain went some way to banishing the horrors of the 7-1 loss to Germany in the 2014 World Cup
The script was perfectly written for Neymar to be the hero and he took full advantage as he blasted in the winning penalty
Tge Brazil side have a team talk at the end of the 120 minutes as they get ready for a penalty shoot-out
With extra-time on the horizon, Brazil players take liquid on board and limber up as they go for gold
Olympic football may be a sideshow for most but it has been the main event for the millions of Brazilians that, throughout the competition, have crammed around TVs and filled stadiums at an Olympics when tickets have proved hard to shift.
This encounter offered a chance to both make amends and history, with this the hosts' grand finale despite the closing ceremony taking place at the same venue the following night.
Poster boy Neymar got Brazil off to an exceptional start, with the star turn lighting up the final with an delightful 25-yard free-kick.
The forward's stunning effort saw the home side boast the lead after a first half in which Germany hit the crossbar three times, with captain Max Meyer eventually levelling within 15 minutes of the restart - the first goal the hosts have conceded at these Games.
The scores remained level as extra-time came and went, but Die Mannschaft would not secure silverware at the ground that witnessed both their 2014 World Cup triumph and women's gold the previous day.
Instead, Nils Petersen's saved penalty allowed Neymar to end the five-time World Cup winners' long quest for men's football gold, bringing relief to a country whose complexities and problems have been reflected at times by their Olympics.
Neymar runs arms outstretched after he fired in a stunning free-kick to break the deadlock for the host nation
There was only going to be one man taking this and Neymar duly obliged by curling the ball into the top corner
The Barcelona superstar struck a lightning bolt pose after he scored, which would have pleased sprint king Usain Bolt
Max Meyer celebrates after his superb finish bought the two sides level in the Maracana stadium
A slow start to the tournament has built up to quite the crescendo for the Selecao, with a remarkable din greeting the players before the national anthem was belted out with plenty of aggression and passion.
Brazil, though, know all too well that such emotion is not always enough and Germany fired a warning shot in the 10th minute, with Julian Brandt curling a beautiful strike that rattled both the crossbar and partisan crowd.
Rogerio Micale's men had looked bright up until that point and continued to threaten, with Luan having an attempt blocked before an inswinging Neymar corner caused havoc.
Miscommunication in the box saw another chance from a corner wasted, but Brazil were soon celebrating an opening goal, and in some style.
Neymar dusted himself down after a foul and took aim from 25 yards, with his exceptional, right-footed free-kick beating Timo Horn and clipping the underside of the bar on its way in.
The noise ratcheted up to a level not heard at these Olympics but Germany attacked undaunted, with a teasing Meyer free-kick directed onto the top of the crossbar by a Brazilian defender.
The highly-rated German captain forced Weverton into a strong save from the resulting corner, before Sven Bender's powerful header hit the woodwork.
Germany's Lars Bender gets the better of the Brazil captain and comes away with the ball during the first-half
The world's fastest man Bolt enjoyed the action from the stands as Brazil won Olympic gold
Gabriel Barbosa (left) sticks a foot out to stop Germany and Arsenal attacker Serge Gnabry making headway
Jeremy Toljan's cross from the right found Meyer in the box, with the Germany captain sweeping home superbly and celebrating the equaliser right in front of the locals.
Manchester City new boy Gabriel Jesus came close to almost immediately putting Brazil back into the lead, before Luan took a tumble looking for a penalty and Neymar superbly cut inside to strike just wide.
Anxiety levels were increasing as Luan and Gabriel Jesus had attempts to settle the match, with Meyer fizzing across the face of goal at the other end as both sides failed to snatch a winner.
Extra-time awaited and dawdling Luan was blocked before Brandt turned just over, with Horn rushing off his line to deny Felipe Anderson shortly after the break.
Substitute Rafinha saw an effort blocked but there would be nothing to split the sides as the match went to penalties.
Both sides scored their first four but substitute Petersen's spot-kick was saved by Weverton, giving Neymar the chance to make history.
He did not waste that moment, sending the Maracana and the whole of Brazil wild.
Brazil's talisman and danger man is the obvious threat and he is well watched here by Bender (left)
Jeremy Toljan (left) shows his strength as he out-muscles new Manchester City signing Gabriel Jesus off of the ball