RIO DE JANEIRO >> With fireworks forming the word "Rio" in the sky, hip-wiggling dancers and supermodel Gisele Bundchen shimmering to the tune of the "Girl from Ipanema," Rio de Janiero welcomed the world to the first Olympic Games in South America with a serious message: Let's take better care of our planet.
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 lifted the curtain on the games of the 31st Olympiad with a high-energy gala celebration of Brazil's can-do spirit, biodiversity and melting pot history.
The opening ceremony, a cut-price but welcome moment of levity for a nation beset by economic and political troubles, featured performers as slaves, laboring with backs bent, gravity-defying climbers hanging from the ledges of buildings in Brazil's teeming megacities and — of course — dancers, all hips and wobble, grooving to thumping funk and sultry samba.
The crowd roared when Bundchen 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."
The show wasn't all frivolous and fun. Images showed swirling clouds of carbon dioxide, a greenhouse gas, in the Earth's atmosphere and images 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 on the floor of the stadium where Germany won the World Cup in 2014.
"The heat is melting the icecap," a voice intoned. "It's disappearing very quickly."
Before the show, in a video broadcast, 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.
As well as a showcase for Brazil's history, culture, diversity and hopes, the gala also represented a triumph, because 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.
But with more than a dash of "gambiarra," the Brazilian art of quick-fixes and making do, Rio is ready.
The honor of declaring the games open will fall to Michel Temer, Brazil's unpopular interim president, standing in for suspended President Dilma Rousseff. Her ouster less than four months out from the games for alleged budget violations was one of the many complications that roiled Brazil's Olympic preparations and 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.
Greece, the historical and spiritual home of the games, led the march by athletes from 205 nations and territories into the stadium. They were being joined by a first-ever 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.
The athletes were being given tree seeds, plus cartridge of soil. When they sprout, they will be planted in a Rio park.
Michael Phelps will lead the U.S. team, the largest with 549 competitors. History's greatest Olympian will be looking to add to his record haul of 22 medals, in three individual swims plus relays, before the Aug. 21 closing ceremony.
On behalf of all 11,288 competitors (6,182 men; 5,106 women), a Brazilian athlete will pledge an oath that they won't take banned drugs — a promise likely to ring false to many fans after the scandal of government-orchestrated cheating in Russia.
While it escaped a blanket ban, Russia is paying the price in the shape of a smaller team, whittled down from a 389 athletes to around 270.
Iran picked a woman, archer Zahra Nemati, as flag-bearer for its team made up overwhelmingly of men.
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, less swish and still inventive. Creative director Fernando Meirelles said their budget was slashed by half as Brazil's economic recession bit ever harder.
He said he hoped that the ceremony would still be "a drug for depression in Brazil."
After Brazil's most famous athlete — soccer star Pele — said he will not appear, the Olympic mystery of who might light the cauldron remained intact.
The cauldron was designed by American sculptor Anthony Howe, who told The Associated Press he was inspired by life in the tropics. There will be two cauldrons in Rio, one at the Maracana soccer stadium that is hosting the opening ceremony and another open to the public in downtown Rio.
The cauldron in central Rio is expected to be lit by a runner after the opening ceremony is finished, Howe said.
NBC broadcast the opening ceremony on a one-hour tape delay because it wants the entertainment spectacle to be shown completely in U.S. prime time. Rio is one hour later than Eastern time.