The opening ceremony in the Maracanã was broadcast to an estimated 3 billion people. Tony Burgess

There was something troubling about how Rio welcomed the Olympics. As the London games were ushered out with a whistle-stop tour of British music, from the Beatles and Bowie to Oasis and One Direction, the Stratford Olympic Stadium hit a sudden, electrified crescendo. Brazil had arrived. 

That unique, 2/4 drum beat filled the stands, and on came carioca dustman Renato Sorriso dancing the samba. It was bombastic, it was brilliant, it was oh-so-Brazilian. But that cliché, of the happy-go-lucky Rio labourer sustained by the magic in his feet, is condescending. It is an equation of poverty and happiness comforting to anyone living in a bubble where hardship is not the norm. It reassures us that all is right with the world. And Rio willingly danced along to the beat of this worn-out old drum.

Two weeks before, Danny Boyle's bonanza of Britishness had been nothing short of stellar. London’s opening ceremony was brilliant for its ability to meet with the best and worst of British and treat those two impostors just the same. The Jerusalem built upon England’s green and pleasant land was steamrolled backwards as Blake’s Satanic mills filled the sky. Britain’s very own Industrial Revolution was adroitly cast as an assault on the landscape and a sudden thrust into modernity. It made Brunel’s cast-iron Olympic rings one of the Olympiad’s most enduring scenes.

Boyle even found the time to stick it to the ruling classes. The previous November, 400,000 NHS care staff had downed tools and walked out in protest to Andrew Lansley’s more than controversial proposals for a new health act aimed at abolishing Primary Care Trusts and feeding NHS funding through GP-led consortia.

Eight months later, they were the protagonists of one of the more touching moments in Boyle’s showpiece. The dancing doctors and nurses, together with children from Great Ormond Street, converged to create a glowing mosaic of the NHS logo that was beamed worldwide. It elicited one of the most earnest cheers from the London locals.

Cameron and co. had probably expected to take their box seats in the Olympic stadium, sip on champagne and pat themselves on the back over a job well done. London’s celebration of all things British simply would not let them.

Not so Brazil. The biggest statement of Friday’s curtain-raiser was not made by what Rio had, but what it lacked. There was so little fanfare, so little pomp and circumstance. In keeping with a shoehorned-in ecological theme, Brazil’s Olympic flame is a humble cauldron powered by the wind, much unlike London’s more ostentatious conflagration. Where London was celebratory, Rio was apologetic, almost funereal.

Rio’s ceremony was marked by a conscience for the day to day challenges for its citizens. Its creative director, Fernando Meirelles, most famous for his masterful City of God – an astonishing portrait of life in the Rio favelas – would not have it any other way. Explaining this year’s more modest budget, Meirelles said, “We are in a financial crisis, everybody knows. It wouldn’t be fair to spend money that London spent in their ceremony.”

How right he is. Last year the CIA’s World Factbook estimated that 2.14% of all Brazilians live in poverty. The world’s fifth largest country is home to 45 million people living beneath the breadline. And by UNESCO figures, it is also home to 20 million people who cannot read or write.

Despite the best efforts of organising bodies like FIFA and the IOC to flog their events as keys to national development, it is clear that Brazil’s poor will never see the benefit. Look back to 2007 and the Pan-American Games in Rio. The Americas’ answer to the Olympics was bankrolled thanks to the generosity of Brazil’s federal government, which pillaged 5 billion reais (currently £1.2 billion) from the popular Federal Workers’ Fund, which provides unemployment insurance to Brazilian nationals. A vanity fair flaunting Brazil’s suitability to host further, costly FIFA and IOC events was paid for from the pockets of those who could scarcely afford it. Nine years later, the facilities paid for at the people’s expense are now propping up an Olympiad that Brazil just does not need. 

These things are always mis-sold. Counterintuitively, international tournaments have never been shown to have an overall effect on the rate of tourism. Jobs created will be temporary and low-paid. And when all is said and done, the final medals draped around necks and national anthems sung, it is a safe bet that purpose-built arenas like the Olympic Equestrian Centre will sit empty and unused, but maintained by the public purse. Just as they have for the past nine years.

Yet the lie found its way into the stadium, forced down the throats of a defiant Maracanã. Carlos Arthur Nuzman, President of the Brazilian Olympic Committee and former volleyball player for the Brazilian team, was scheduled to give a three-minute speech welcoming the Games to the city, but his droning mess felt like eternities longer. And it was given the reception it duly deserved when 80,000 Brazilians present were invited to thank the federal government for funding the whole thing. IOC President, Thomas Bach, later speechified on the Olympiad’s power to modernise the city of Rio, as if it were some sort of retrograde backwater that could only be brought into the 21st century by the presence of a dressage arena.

Clearly the idea that they would be roundly booed by vast sections of the arena had escaped them. Thankfully for him, Brazil’s acting president Michel Temer had come prepared; his fourteen-word speech declaring the Olympiad open just brief enough to prevent him being drowned out by the jeers that accompanied him back to his seat. 

Rio’s opening ceremony was set apart as the battleground in one great class war. The Maracanã’s audible boos were as much an act of resistance, as one of celebration of the downtrodden just as great as the fireworks, samba dancing and the stunning Trompe-l'œil projections onto the arena floor.

Despite all the sermonising about the wonders of the Brazilian government and the IOC, Brazil’s people were given the last word. A living diorama of the Amazonian rainforest cast a nod to the country’s indigenous population. The sweeping lines and free forms of the expanding metropolitan landscape honoured Brazil’s modern artists and architects. And the pounding rhythm of the passinho – a popular form of dance in the favelas  was so daringly anti-establishment. The culture of Brazil’s margins took pride of place at centre stage.

The true genius of Friday’s festivities was their obstinacy in the face of a political crisis, their triumphalism where triumph felt elusive. It was an invitation not to ignore the turmoil in Brazil, but to tackle it head-on, and to look beyond it, to a nation that is and can be so much greater. Judi Dench, reciting the work of Brazilian poet Carlos Drummond de Andrade, channelled this sentiment entirely. A flower sprouting through the asphalt captivates its narrator in a desperate search for beauty in metropolitan Brazil. "It’s ugly," she says. "But it’s a flower."

What is happening in Brazil is ugly. But if you look hard enough, there is something beautiful to celebrate.