Unheralded Brazilian Thiago Braz Da Silva sent the home crowd wild on Tuesday as he trumped France's defending Olympic champion Renaud Lavillenie to win the men's pole vault title.
In a thrilling competition, Da Silva won gold with an Olympic record of 6.03m.
After two botched efforts at 6.03 Lavillenie pitched everything on a last-gasp vault at 6.08m, but failed and had to be content with silver with a best of 5.98m.
American Sam Hendricks took bronze with 5.85.
Lavillenie copped the wrath of the Brazilian public as he prepared for his final vault. Obviously barracking for the 22-year-old local, passion spilled over into jeers and boos directed the Frenchman's way.
Unhappy with the crowd's behaviour, the 2012 London gold medallist waved his finger in displeasure before giving the camera a thumbs down.
But in the end the parochial Brazilians got what they were after as Lavillenie couldn't clear the height.
To say everyone in the stadium went absolutely nuts would be an understatement.
Former Olympic gold medallist in the pole vault Steve Hooker said he was privileged to have witnessed such an incredible moment in Olympic history.
"It's unbelievable. This will be the moment of the Olympic Games for Brazil," Hooker said on Channel 7.
"He took on the guy that I think is the best that has ever been and beat him when he was at his best.
"It was exceptional, an unbelievable effort.
"I don't think we've ever seen anything like this in the Olympics competition in the pole vault before.
"The energy in the stadium was incredible."
It was simply an amazing feat by Da Silva, who had never before won a medal in a senior global competition. He finished 19th at the 2015 World Championships and his previous personal best was 5.93m - a whopping 10cm below what he managed to vault on Tuesday.
In March this year he could only scrape together a performance worthy of 12th at the IAAF World Indoor Championships with a best of 5.55 - hardly a showing that bode well for these Games.
But that's what the Olympics are about. Seeing someone come from nowhere to achieve something that most people assume is beyond them. And it was made even sweeter this time around that it was done by a Brazilian.
Da Silva's winning height of 6.03m saw him record the best outdoor performance by a pole vaulter since 2008.
- additional reporting AFP