Brazil is no stranger to economic crisis. For decades until 1994 it had been in a state of perpetual financial turmoil, with inflation rising so fast that shops had to change their prices every day.
It is a mark of just how far Brazil has progressed since those dark days that a controlled devaluation is an act of global significance that sends markets plunging all over the world, as happened on Wednesday morning.
Unfortunately for Brazil - the world's fifth-most populous country and the eighth-largest economy - the current crisis is proving that maybe it progressed too quickly without changing any of the other factors that have kept it in a cycle of boom and bust since, it could be argued, its discovery 499 years ago.
The root of Brazil's troubles is that it lives way beyond its means. It spends much more - on government departments, on public workers, on repaying debts - than it receives in taxes, giving it an untenable public deficit currently at about 8 per cent of GDP.
When, in 1994, finance minister Mr Fernando Henrique Cardoso implemented a new currency, the real, closely pegged to the dollar, he defeated hyperinflation overnight and gave the economy a stability from which he hoped he could build long-term growth. The real was such a success that it was the major factor in electing Mr Cardoso as president that year and re-electing him last October.
Mr Cardoso started a massive programme of privatisations that brought billions of dollars into the country and made Brazil the darling of foreign markets and the largest recipient of foreign investment after China.
The influx of dollars also created reserves of more than $60 billion (#52.2 billion) that helped buttress the real, which was becoming heavily overvalued because monetary policy decreed it was tied to the dollar.
But the triumphalism of Brazil's new position in the global economy was always going to be shaky if nothing was done about the yawning deficit. After the crises in Asia and then Russia, investors started to panic about emerging markets. Refusing to devalue, Mr Cardoso's only weapon to stop dollars leaving the country was to put up interest rates to almost 50 per cent.
The high interest rate was a double-edged sword. It slowed down the flow of dollars but put a straitjacket on the economy and slowed growth. With the country heading into recession, unemployment was reaching highest ever levels and support in Congress for much-needed budget cuts was harder to achieve.
Brazil's importance to the world economy - US banks are twice as exposed to Latin America as they are to the Far East - caused the International Monetary Fund to agree in November an unprecedented $41.5 billion rescue package. The IMF money, however, is dependent on Brazil balancing its books.
When last week Mr Itamar Franco, Mr Cardoso's predecessor as president and now governor of the important Minas Gerais state, said he was defaulting on the state's debt to central government, he sent a loud signal to investors that fulfilling the IMF's demands was not a fait accompli.
Mr Franco's standoff with Mr Cardoso dismayed analysts who described the governor's act as selfish, designed to put his oar in as main opposition presidential candidate in 2002 while letting the country collapse around him. Such is the fiery nature of Brazilian politics, where the dozen-plus parties are not based on policies but on personalities.
The Minas default caused dollars to leave the country again in billions, reducing reserves, it is believed, to only about $35 billion ($45 billion when the first tranche of IMF funds is included). The new outflow must have caused heated arguments at the Central Bank between its president, Mr Gustavo Franco, and the director of monetary policy, Mr Francisco Lopes, on whether the dollar-pegging strategy was working. Mr Lopes won, Mr Franco resigned and immediately the band within which the real could trade at was widened, causing instant devaluation of about 9 per cent as the real leapt to the top of the new band.
Brazilians are by nature a laid-back people and while Wednesday's events were possibly the most dramatic of Mr Cardoso's presidency, there was none of the mass hysteria associated with the Far Eastern devaluations. With the country going into recession, there is also a feeling that a slight devaluation could help exporters and assist in getting people back to work.
The markets were calmer yesterday, so it was not clear whether the devaluation was going to be a success or a failure. The state of uncertainty was echoed in a front-page editorial in the influential newspaper Folha de Sao Paulo: "No one knows if the markets will sufficiently understand the attempt of a controlled devaluation or if, on the other hand, they will force new devaluations, possibly uncontrolled." Brazil and the world anxiously await the answer to this question.