Brazil unfurled a vast canvas celebrating its rainforest and the creative energy of its wildly diverse population as it welcomed the world on Friday to the Olympic Games in Rio de Janeiro, as the country sought to forget its troubles for a night with a glittering opening carnival.
The ingenious four-hour spectacular at the Maracana Stadium took 78,000 spectators and athletes on a dizzying journey spanning the dawn of creation to the birth of modern-day Brazil.
Indigenous tribes, dueling dance groups and an eye-catching appearance from supermodel Gisele Bundchen were among the highlights of a show unashamedly low on technology but high on invention, a symptom of economic constraints faced by the recession-hit nation.
But the overwhelming theme of the evening was protection of the environment.
"It is not enough to stop harming the planet, it is time to start healing it," programme notes from the ceremony's organisers read.
"This will be our Olympic message: Earthlings, let's replant, let's save the planet!"
An early opening sequence depicted the birth of life, culminating in the sprouting of a green entanglement of leaves from the stadium floor depicting the Amazon rainforest.
Indigenous Brazilians then performed native dances before creating huge "Ocas" or native huts in the center of the stage.
That gave way to an exuberant, joyous party which encompassed Brazil's breathtakingly diverse musical and cultural traditions.
A memorable skit showed the rise of a metropolis, complete with roof-hopping parkour groups.
That was followed by a magical interlude paying tribute to beloved aviation pioneer Alberto Santos-Dumont, whose wicker 14 Bis "aircraft" then took the audience on a night-flight across a twinkling Rio cityscape.
Marathon runner Vanderlei Cordeiro lit the cauldron after an exuberant show of Brazilian cultural touchstones and breathtaking pyrotechnics -- and a compulsory burst of samba.
But in a reminder of Brazil's parlous political and economic situation, boos and jeers greeted interim president Michel Temer before he declared South America's first Olympic Games open.
Temer took over when impeachment proceedings started against President Dilma Rousseff, whose supporters accuse him of plotting against the suspended leader.
Despite the resentful undercurrent, and protests against the Games just hours earlier, spirits were high among the thousands of athletes, performers, fans and officials at the 78,000-capacity Maracana.
"The Olympic dream is now a wonderful reality. The best place in the world is here and now," said organising committee chief Carlos Nuzman, to rapturous applause.
Brazilian singer Paulinho da Viola sang the national anthem to set off the show of laser lights and elaborate dances highlighting Brazil's history and rise as an emerging power.
Brazil's Gisele strutted into the arena to the iconic "Girl From Ipanema" before Greece, home of the ancient Olympics, led out the colourful athletes' parade.
More than 10,000 athletes from 207 teams took part, with the biggest cheers reserved for the specially formed refugee team and the joyous Brazilian athletes.
Iran's flagbearer was wheelchair-bound Zahra Nemati, their first ever female flag-carrier who will compete in archery despite being paralysed in both legs.
Each athlete was presented with a seed and a cartridge of soil to enable them to plant a native tree of Brazil, which will ultimately form an "Athletes Forest" made up of 207 different species -- one for each delegation.
Loud cheering erupted when two of the last teams entered the stadium: the first Refugee team
'No to the Olympics!'
Unlike the opening ceremonies in Beijing in 2008 and London in 2012, a financially constrained Brazil had little choice but to put on a more "analogue" show, with minimal high-tech and a heavy dependence on the vast talent of Brazil and its Carnival party traditions. In the nearly four-hour event, nothing appeared to go awry.
Brazil has spent more than $10 billion on new infrastructure and preparing for the Games at a time of economic crisis.
The billions lavished on the Games has angered many Brazilians as the country grapples with a tanking economy and mass social problems.
Friday's ceremony lifts the curtain on a more than two-week sporting festival featuring superstars like Michael Phelps and Usain Bolt, as well as thousands more who will compete for 2,102 medals until August 21.
The first gold medal will be awarded on Saturday in shooting and all eyes will be on American swimming star Phelps, the most decorated Olympian in history, when he returns to the pool in the first week.
Track and field will see Jamaica's Bolt aim to defend his 100m, 200m and 4x100m crowns by clinching all three for the third straight Games.
Gymnastics, meanwhile, could unearth a new heroine in America's teenage star Simone Biles, while rugby and golf return to the Olympic programme after gaps of 92 years and 112 years respectively.