When Brazil hosted the World Cup in 2014 the country dreamt of glory, but the beloved national team was thrashed and the tournament left a legacy of unfinished works, huge debts and missing funds.
Brazil were hoping to add a sixth trophy to their record five World Cup triumphs, while officials promised that private finance would spare taxpayers the budgetary pain.
The optimistic view seemed credible when the hosting rights were awarded to Brazil in 2007. The economy was booming and two years later Rio would be named to host the 2016 Olympics.
But things turned out differently -- and not just because the home side went out in a humiliating 7-1 semi-final defeat to Germany.
The original budget of 17 billion reais ballooned to 27 billion reais (about $11.5 billion at that time). And of the 8.3 billion reais spent on building 12 stadiums, only seven percent came from private investors.
"Spending went greatly over projections, with a lot less being completed than had been promised," said Paulo Henrique Azevedo at Gesporte, which studies sports management at the University of Brasilia.
"In numerous cities, transport infrastructure projects were not only unfinished but totally abandoned, despite having already cost millions of reais," he said.
This included airports, tram lines and dozens of other projects that, according to a study by Folha de S.Paulo newspaper, would eventually have brought benefits to 2.5 million people.
Rio de Janeiro was the one city that saw all its projects completed, but only in time for the Olympics rather than the World Cup.
The mayor at the time, Eduardo Paes, said the World Cup legacy was marked by "white elephants and feeble private investment." His own management of the Olympic legacy would later receive equally harsh criticism.
Azevedo said the basic error committed in Brazil for the World Cup was "building too many stadiums for political reasons."
Some of the 12 stadiums built, like in Manaus, Cuiaba and Brasilia, were in cities with no big team to take over the facilities once the tournament was over.
- Corruption -
For Brazil's notoriously corrupt local and federal politicians, the spending spree was a bonanza in overbilling, skimming and pay-to-play schemes with contractors.
For example, organizers paid three times the market rate for concrete during renovations at the famous Maracana stadium in Rio, which hosted the World Cup final and later the Olympic opening and closing ceremonies.
In 2012, former Brazilian star striker Romario, who is now a senator, was predicting that the World Cup would be "the biggest robbery in history."
For ordinary Brazilians, the Germany defeat was probably the bitterest part of the experience.
"In the collective memory, that 7-1 humiliation looms larger than all the mistakes committed by Brazil," wrote sports journalist Rodrigo Mattos in his 2016 book "Ladroes de Bola," or "Thieves of the ball."
On the plus side, the actual tournament passed off smoothly, an experience that paved the way for the equally successful hosting of the Olympics -- despite the behind-the-scenes infrastructure and corruption problems.