RIO DE JANEIRO -- With fireworks forming the word "Rio" in the sky and supermodel Gisele Bundchen shimmering to the tune of "The Girl From Ipanema," Rio de Janiero jubilantly welcomed the world Friday to the first Olympic Games in South America.
After one of the roughest-ever rides from vote to Games by an Olympic host, the city of beaches, carnival, grinding poverty and sun-kissed wealth opened the two-week Games of the 31st Olympiad with a high-energy gala celebration of Brazil's can-do spirit, biodiversity and melting pot history.
The low-tech, cut-price opening ceremony, a moment of levity for a nation beset by economic and political woes, featured performers as slaves, gravity-defying climbers hanging from buildings in Brazil's teeming megacities and -- of course -- dancers, all hips and wobble, grooving to thumping funk and sultry samba.
Brazil also packaged its party with solemnity, lacing the fun and frivolous show with sobering messages about global warming and conservation. Images of carbon dioxide, a greenhouse gas, swirling in the Earth's atmosphere were followed by projections of world cities and regions -- Amsterdam, Florida, Shanghai, Dubai -- being swamped by rising seas.
The peace symbol, tweaked into the shape of a tree, was projected onto the floor of the Maracana Stadium that filled with thousands of athletes from 207 teams.
"The heat is melting the ice cap," a voice intoned. "It's disappearing very quickly."
The crowd roared when Bundchen, the Brazilian supermodel and wife of New England Patriots quarterback Tom Brady, sashayed from one side of the 78,000-seat Maracana Stadium to the other as Tom Jobim's grandson, Daniel, played his grandfather's famous song about the Ipanema girl "tall and tan and young and lovely."
In a video preceding the show, U.N. Secretary-General Ban Ki-moon said the Games "celebrate the best of humanity" and appealed for an Olympic truce, calling on "all warring parties to lay down their weapons" during the two weeks of sporting achievement.
There were times after the International Olympic Committee selected Rio ahead of Chicago, Tokyo and Madrid in 2009 when it seemed that the city of 6.5 million people might not get its act together for the world's greatest sporting mega-event. The spreading health crisis of the mosquito-born Zika virus kept some athletes away.
Promises to clean Rio's filthy waters remained unfulfilled. The heavy bill for the Games, at least $12 billion, made them unpopular with many. Heavily armed security stopped a small group of protesters from getting close to the stadium ahead of the ceremony.
But with more than a dash of "gambiarra," the Brazilian art of quick-fixes and making do, Rio is ready.
"Our admiration is even greater because you managed this at a very difficult time in Brazilian history. We have always believed in you," IOC president Thomas Bach said.
The honor of officially declaring the Games open fell to Michel Temer, Brazil's unpopular interim president, who was loudly jeered and faced shouts of "out with Temer." He was standing in for suspended President Dilma Rousseff. Her ouster less than four months before the Games for alleged budget violations was one of many obstacles in the works of Brazil's Olympic preparations, and it impacted the opening ceremony itself.
Fewer than 25 foreign heads of state were expected, with others seemingly staying away to avoid giving the impression of taking sides amid Brazil's leadership uncertainty. As Brazilian officials took their seats in the stadium, there were shouts of "out with Temer" from sections of the crowd.
Jamaica's Usain Bolt, the two-time defending champion in the Olympic 100- and 200-meter races, skipped the ceremony, as expected. Bolt announced his decision earlier in the day. Friday was the fourth anniversary of Bolt's winning the gold in the 100 at the London Games.
Also missing was 75-year-old Brazilian soccer great Pele, who announced earlier Friday that he was "not physically able to attend the opening of the Olympics." He had previously said this week that he had been invited to light the cauldron, although that was not confirmed by Rio organizers.
Instead, the cannonball-shaped cauldron was lit by Brazilian marathoner Vanderlei Cordeiro de Lima. At the 2004 Games, an Irish spectator wearing a kilt, knee-socks and a beret tackled de Lima while he was leading the Olympic marathon. Rather than gold, he fell back to take bronze.
Greece, the historic and spiritual home of the Games, led the march by athletes into the stadium. They were joined by the first Refugee Olympic Team of 10 athletes displaced from Syria, South Sudan, Congo and Ethiopia. Their flag-bearer, Rose Nathike Lokonyen, fled war in South Sudan and ran her first race in a refugee camp in northern Kenya. Only Brazil's team, which marched last, drew a louder roar from the crowd than the refugees.
The athletes were given tree seeds, plus cartridges of soil. When the trees sprout, they will be planted in a Rio park.
With "USA" emblazoned on the back of his jacket, Michael Phelps carried the flag for the U.S. team, the largest with 549 competitors. At his fifth Olympics, it was the first time the record-holder of 22 medals had marched in an opening ceremony, having skipped previous ones to save energy for competition.
On behalf of all 11,288 competitors (6,182 men and 5,106 women), Brazilian two-time Olympic champion sailor Robert Scheidt pledged not to take banned drugs -- an oath likely to ring false to fans after the scandal of government-orchestrated cheating in Russia. As a consequence, Russia's team was whittled down from a hoped-for 389 athletes to around 270.
Iran picked a woman, archer Zahra Nemati, as flag-bearer for its team made up overwhelmingly of men. Another woman pushed Nemati's wheelchair. The archer was paralyzed in a car accident as a teenager.
Shoals of samba dancers flowed in a rainbow of colors, but many showed less flesh than normal for Brazil, seemingly mindful of their global TV audience.
After the grandeur of Beijing's opening ceremony in 2008 and the high-tech, cheeky inventiveness of London's in 2012, Rio's was earthier and less swish but more sobering with its gloomy environmental look at the future and deliberate penny-pinching. Creative director Fernando Meirelles said the budget, slashed by half as Brazil's economic recession bit ever harder, "is 12 times less than London, 20 times less than Beijing."
"It is pretty tacky to be overspending," he said. "It is not a good message for the world. When 40 percent of the homes in Brazil have no sanitation, you can't really be spending a billion reals for a show. In the end, I feel good that I am not spending money that Brazil hasn't got."
In the U.S., NBC faced social media criticism for its decision to delay the broadcast of the ceremony so it could be shown in prime time in all time zones. Frequent commercial breaks, including eight in the first 65 minutes, also proved frustrating for time-shifting viewers accustomed to fast-forwarding through ads.
NBC began its telecasting of the festivities an hour after they begin in Rio on Friday. On the U.S. West Coast, the telecast of the opening ceremony wasn't set to start for another hour. NBC didn't start streaming the event through its app or Olympics website until the television coverage began, and streamers had to authenticate their account with a cable or satellite service.
Information from The Associated Press was used in this report.