Awarded when Brazil was a rising economic power, the sports pageants focused unprecedented attention on the country -- much of it unwanted. As the shows went on, Brazil plunged into a deep recession. A billion-dollar corruption scandal buffeted state-run oil company Petrobras, and President Dilma Rousseff was removed from office in an impeachment trial just days after the Olympics closed.

"This all left a very mixed legacy," Mauricio Santoro, an international relations expert at the State University of Rio de Janeiro, told The Associated Press. "We are going to need some years to evaluate what was the impact, the worth of these events for Brazil."

By a conservative estimate, Brazil spent about $30 billion organizing the events with a mix of public and private money that included the construction of four white-elephant soccer stadiums for the World Cup. All four are in cities without major teams. Rio fared better with the Olympics, getting a metro line extension, bus lines, and light-rail. But much of the investment was aimed at Rio's upscale suburb of Barra da Tijuca -- not at the city's sprawling favelas, or slums. The Olympic Park and Athletes Village there will be molded into high-priced commercial and residential properties now that the games are done.

"I think the Olympics and Paralympics were a boost to the self-esteem of Brazil," Santoro said. "They happened when everything was going so bad in Brazil. The mere fact they happened without serious problems, without an infrastructure disaster, without a terrorist attack, made Brazil feel better about itself."

Brazil's reputation away from home is another matter. Only a handful of foreign leaders attended the Olympics -- compared to about 100 four years ago in London. The state of Rio de Janeiro is broke and defaulting on bond payments. Some schools have suspended classes, and hospitals are understaffed. Only a last-minute bailout of about 250 million reals (USD 76.5 million) from the federal and local  governments saved the Paralympics from a shortfall in the organizing committee's privately funded operating budget.

"There was a feeling that Brazil is such a big mess," Santoro said. "How could you have a good opinion of this
country?"