Neymar stepped forward to seal the gold medal Brazil craved above all others as the five-time World Cup winners became Olympic champions for the first time with a 5-4 penalty shootout triumph over Germany, following a pulsating 1-1 draw at the Maracana.
Usain Bolt took his place among the crowd at a fervently partisan Maracana and national icon Neymar put Brazil ahead with a stunning free-kick.
The Barcelona superstar was an injury absentee when Germany humiliated Brazil 7-1 in the semi-final of their home World Cup in 2014, but Max Meyer made him and a football-crazed nation wait a little longer for redemption.
Extra-time could not produce a winner and there were eight flawless spot kicks until Freiburg striker Nils Petersen, scorer of six goals in the tournament, saw Weverton guess correctly and parry his attempt to safety.
It set the stage perfectly for Neymar to secure the title and banish the memory of the torment Germany inflicted upon Brazil two years earlier.
He did not disappoint, coolly picking out the top-right corner before dropping to his knees and breaking down into tears of joys, while swarmed by team-mates caught up in undiluted delirium.
Germany tested the crossbar three times during the first-half - initially when Julian Brandt's sweetly struck shot cannoned to safety with Weverton beaten.
The hosts' much-vaunted frontline of Luan, Gabriel Barbosa, Gabriel Jesus and Neymar began to link pleasingly and, after Renato Augusto spurned an unmarked 23rd-minute chance at the back post, it was Brazil's captain who sent a capacity crowd into raptures.
Neymar's 25-yard free-kick was simply sumptuous, leaving Timo Horn grasping helplessly as it found the net via the underside of his bar.
Germany refused to be daunted by the scoreline or a now ramped-up party atmosphere and a Meyer free-kick caused havoc - his delivery from the left deflecting and skimming to top of the crossbar.
From the resulting corner, Weverton saved sharply from Meyer and Matthias Ginter was unable to convert the rebound.
Germany struck the bar once more when Bender got in front of Renato Augusto to come agonisingly close from Brandt's cross, but Brazil's slender advantage was wiped out 14 minutes into the second half.
The influential Bender was involved, sliding Jeremy Toljan down the right-flank and the full-back pulled the ball into Meyer's path for a crisp finish.
In the 65th minute, Gabriel Jesus side-footed wide when picked out by the tireless Renato Augusto and Brazil resumed the ascendancy as an absorbing 90 minutes ended all square.
Luan saw a shot blocked at the end of a mazy run and Brandt sent a nimble volley looping over Weverton's goal - the intensity of the match remaining unchecked.
Early in the second half of the additional period, Neymar's exquisite reverse pass sent Felipe Anderson racing clear of the Germany defence but the substitute shot too close to Horn, who was powerless to stop Neymar when destiny called.