Brazil's interim President Michel Temer declared open the first Games ever in South America. But in a display of the deep political divisions plaguing Brazil, he was jeered by some in the crowd at the famed Maracana soccer stadium.
The opening ceremony was decidedly simple and low-tech, a reflection of Brazil's tough economic times. In one of the world's most unequal societies, the spectacle celebrated the culture of the favelas, the slums that hang vertiginously above the renowned beaches of Rio and ring the Maracana.
There was no glossing over history either: from the arrival of the Portuguese and their conquest of the indigenous populations to the use of African slave labor for 400 years. The clash of cultures, as the ceremony showed, is what makes Brazil the complex mosaic that it is.
Home to the Amazon, the world's largest rainforest, Brazil used the ceremony to call on the 3 billion people watching the opening of the world's premiere sporting event to take care of the planet, plant seeds and protect the verdant land that Europeans found here five centuries ago.
Unlike the opening ceremonies in Beijing in 2008 and London 2012, a financially constrained Brazil had little choice but to put on a more "analog" show, with minimal high-tech and a heavy dependence on the vast talent of Brazil and its Carnival party traditions.
While the Rio 2016 organizing committee has not said how much the ceremony cost, it is believed to be about half of the $42 million spent by London in 2012.
The show drew homegrown stars, like supermodel Gisele Bundchen, who walked across the stadium to the sound of bossa nova hit "Girl from Ipanema" and Paulinho da Viola, a samba songwriter who sang the national anthem with a string orchestra. Everyone performed for free.
Loud cheers erupted when Brazil's beloved pioneer of aviation Alberto Santos-Dumont was depicted taking off from the stadium and flying over modern-day Rio.
The joyful opening contrasted with months of turmoil and chaos, not only in the organization of the Olympics but across Brazil as it endures its worst economic recession in decades and a deep political crisis.
Temer, flanked by dozens of heads of state, played a minor role in the ceremony, speaking just a few words. The leader who was supposed to preside over the Games, President Dilma Rousseff, was suspended last May to face an impeachment trial and tweeted that she was "sad to not be at the party."
The $12 billion price tag to organize the Games has aggrieved many in the nation of 200 million and in Rio, where few can see the benefits of the spectacle or even afford to attend the Games.
Due to Brazil's most intense security operation ever, some among the 50,000 attendees faced two-hour-long lines as Brazil staged its most intense security operation ever.
PEOPLE ON THE PERIPHERY
The creative minds behind the opening ceremony were determined to put on a show that would not offend a country in dire economic straits but would showcase the famously upbeat nature of Brazilians.
It started with the beginning of life itself in Brazil, and the population that formed in the vast forests and built their communal huts, the ocas.
The Portuguese bobbed to shore in boats, the African slaves rolled in on wheels and together they plowed through the forests and planted the seeds of modern Brazil.
"They're talking about slavery? Wow," said Bryan Hossy, a black Brazilian who watched the ceremony in a bar in Copacabana. "They have to talk about that. It's our story."
The mega-cities of Brazil formed in a dizzying video display as acrobats jumped from roof to roof of emerging buildings and then on to the steep favela that served as the front stage for the ceremony.
From the favela came Brazilian funk, a contemporary mash-up of 20th century rhythms, sung by stars Karol Conka and 12-year-old MC Soffia.
"This is a conquest. The people on the periphery are having an influence, it's a recognition of their art," said Eduardo Alves, director of social watchdog Observatorio de Favelas.
Before the entry of a few thousand of the 11,000 athletes that will be competing in the Games, the playful rhythms of the ceremony gave way to a sober message about climate change and rampant deforestation of the Amazon. Actresses Judi Dench and Fernanda Montenegro lent their voices for a classic poem about hope for the future.
Each athlete will be asked to plant seeds that will eventually grow into trees and be planted in the Athletes Forest in Rio in a few years.
Brazilian runner Vanderlei Cordeiro de Lima lit the Olympic cauldron at the opening ceremony.