Many Brazilians watched the closing ceremony of the London Olympics with trepidation. "Do you think we will be able to manage anything more than a couple of carnival floats, some football and traffic jams?" mused one of my friends.
It is a few years since I have heard such expressions of national self-doubt. When I first arrived in Brazil, almost 10 years ago, the country had just elected its first leftwing president, Luiz Inácio "Lula" da Silva. Both the currency and stock exchange were in freefall as investors took fright. There had been an attempted coup against Hugo Chávez in Venezuela the previous year and the pride of my Brazilian friends – who were mainly members of Lula's Workers' party – was mixed with some anxiety.
Lula's first term in office combined cautious economic orthodoxy and some important social reforms. The minimum wage was raised significantly and an innovative cash transfer programme called Bolsa Família introduced for poor families. A start was also made in reforming the Brazilian justice system. At the same time the government kept an eye on public spending, ran a primary budget surplus and began to reduce the national debt. Inflation remained low, which preserved the value of its social programmes, and living standards rose. Brazil shrugged off the world financial crisis, which Lula famously blamed on blue-eyed bankers, and was able to credibly launch a countercyclical spending programme, while simultaneously becoming a creditor to the IMF. The discovery of a massive oil field off the coast of Rio de Janeiro was followed by winning both the next World Cup and Olympic Games. Who could argue with Lula's triumphant declaration that "God is Brazilian"?
These days that proposition may have fewer takers. Economic growth stalled last year, choked by a hugely overvalued currency. This year looks even worse, as export demand has been hit by the global recession. While the government's success in reducing its still astronomically high inequality was a spur to domestic demand, economic growth was underpinned by the export of primary commodities such as soya, coffee and iron ore. But this masked two weaknesses in the economy: a terrible infrastructure and a bureaucracy that is vast, crushing and quite often corrupt.
Viewed from this perspective, Lula's presidency, which ended with stratospheric approval levels, does not seem quite so successful. Reforms petered out in his second term. Government spending continued to expand, but most went on increasing the size of the grossly inefficient state. His handpicked successor, Dilma Rousseff, is being forced to make some tough decisions that Lula ducked.
Teachers at federal universities have been on strike for three months now and have recently been joined by nearly half the federal workforce. Striking police have blocked roads and worked to rule at airports, causing travel chaos. Much of the judiciary is also on strike, having not received a single pay increase for over five years, while inflation has been chipping away at the cost of living. The strikes are largely led by Workers' party-affiliated trade unions and president Rousseff's determination to face them down has caused dismay among many of her traditional supporters.
At the same time the party's prestige has been badly hit as the trial finally takes place of most of its previous leadership in relation to a corruption scandal that badly damaged Lula's first term. The supreme court is currently hearing allegations that the party siphoned money from state-owned enterprises to buy the votes of opposition members of congress, through a process that became known as the "big monthly payment" (mensalão). Such practices may have been used by some of the party's opponents previously, but they fatally damaged its reputation as a "clean-hands" party.
To her credit, Rousseff has taken a strong stand against corruption, dismissing a clutch of ministers from the Lula era who were facing accusations. This has won her support across the political spectrum and she may also gain credibility for her determination to restore some discipline to public finances. However, with no overall majority in parliament and growing opposition within her own party, facing down the corporate state will be a big challenge.
Brazil is conscious that the eyes of the world will focus on its handling of the Olympics. As Rio's mayor, Eduardo Paes, put it when interviewed by the Economist: "For 30 years the only news on the BBC about Rio was violence. Now they are showing other things. There will be criticisms, but the city's image is being transformed." This will certainly be true if it can rise to the challenge. But, as Brazilians often joke, their country has a bright future ahead of it: and always will have.
Conor Foley is a humanitarian aid worker who has worked for a variety of human rights and humanitarian aid organisations.