RIO DE JANEIRO, Brazil (MarketWatch) — Over the past few years Brazil has seen itself catapulted onto the world stage thanks to its booming economy and dynamic growth trajectory. With a GDP predicted to total $2.4 trillion for 2011, the Latin American giant looks set to overtake the U.K. to become the world’s sixth largest economy by the end of the year.

However, fortune has not always favored Brazil.

Just over two decades ago the country was limping out of a military dictatorship under the weight of a crippling national debt that saw Brazil pay out more than $49 billion in interest payments alone during 1999 — more than double what it spent on health care that year.

Moreover, inflation had been spiraling out of control since the 1960s. In one 12-month period between 1989 and 1990 it reached a high of 2,700%, with prices rising by up to 80% in the course of a single month.

Saddled with this legacy of debt, inflation and slow growth, Brazil in the 1990s looked like just another ailing emerging market. Then, through a series of smart economic reforms, an ambitious privatization program and luck, Brazil hoisted itself to prominence and looks set to prosper. But challenges, including weakening global growth, cozy trade ties with China and the United States, and endemic crime and corruption threaten to make Brazil’s role as an economic star difficult to sustain.

A real plan

After stumbling into the 1990s as an economic wreck following a string of failed efforts to contain runaway inflation, the government acted decisively in early 1994.

“The Plano Real was the real turning point,” said Larry Rohter, a New York Times reporter and author of the book “Brazil on the Rise.” This was essentially a three-point plan implemented in 1994 as a last-ditch attempt to get inflation under control. Its first move was to give Brazil a new currency — the real — which was initially pegged to the dollar.

The government simultaneously raised interest rates, which attracted foreign investment, and opened the economy up to the outside world.

“This made imported goods cheaper, which dampened inflationary pressures by forcing Brazilian companies to sell their products at lower prices out of fear of losing their market share,” Rohter said.

At the same time, the government implemented fiscal reforms that included the privatization of a number of inefficient government-run companies which had steadily bled money from public coffers.

With inflation under control and in the care of a new democratically elected government, Brazil finally found the stability it needed to begin its economic transformation.

“Virtually all the good things we have achieved in recent years would not have been possible with high inflation and the lack of predictability that came with it,” said Gustavo Mendonça, an economist at the Rio de Janeiro–based asset management firm Oren Investimentos.

“ ‘[The Plano Real] is, to my mind, the most important event in Brazil’s economic history.’ ” — Gustavo Mendonça, Oren Investimentos

“[The Plano Real] is, to my mind, the most important event in Brazil’s economic history.”

BRICs, oil and sports

Seven years of steady growth later, Brazil’s progress received international recognition. In 2001 Jim O’Neill, chairman of Goldman Sachs Asset Management, wrote a paper predicting that, by 2050, Brazil, Russia, India and China would be richer and more powerful than most of the world’s current major economic powers, and lumped the four together under the term “BRIC.”

Thus Brazil found itself united, if only by acronym, with three other emerging world players and all four countries were given a global PR boost.

The next major developments came back-to-back in 2007. On Oct. 30, international soccer’s governing body, FIFA, announced that Brazil had won the contest to host the 2014 World Cup, the world’s biggest sporting event.

Just 10 days later, the news was eclipsed when the government announced a windfall discovery of vast oil fields off the coast of Rio de Janeiro, which became known locally as the “Pre-sal.”

According to estimates from Brazil’s National Petroleum Agency, around 50 billion barrels of oil have been identified so far, making this the biggest oil find in the country’s history. It has the potential to launch Brazil into the ranks of the world’s top five oil producers.

“This discovery proves ... that God is Brazilian,” then–President Luiz Inacio Lula da Silva said in a speech from the presidential palace in November of that year.

And as if all that wasn’t enough, in 2009 Brazil was awarded the 2016 Olympic Games.

Residents celebrate after Rio de Janeiro wins the right to host the 2016 Summer Olympic Games. Reuters

The news was greeted with jubilant celebrations across the nation. The economic boost from the two sporting events will reach into the billions, experts predict.

“Our hour has arrived,” Lula da Silva said, wiping tears from his eyes at a news conference following the announcement. “It has arrived.”

In another, more recent indication of how far Brazil has come, Goldman Sachs’s O’Neill said earlier this week that he no longer considered all the BRIC countries to be emerging economies.

“The phrase I use is ‘growth markets,’ ” he said at a conference in London on Monday. Market Pulse: Goldman’s O’Neill: Time to move beyond BRICs.

However, Mendonça said that while the Olympics and the World Cup will undoubtedly boost the economy in the short term, the oil find is the real winner.

“The Pre-sal is really important, much more so than the Olympics and the World Cup,” he said.

A richer country?

The Brazilian government has pledged to use oil revenue to overhaul the country’s public education and health-care systems and to revamp its failing infrastructure.

“If we go in the right direction,” Mendonça said, “we’ll be a richer country, with one of the biggest oil service industries in the world, a more highly skilled labor force and a more educated and healthier population. In summary: We’ll be much more productive than we are, not only in oil, but as a country.

“If we move in the wrong direction, however, we’ll be a country of one, and only one, industry, rich when oil prices go up and poor when they go down.”

Brazil still grapples with significant levels of crime and corruption, which threaten to undermine its many successes. In opinion polls Brazil is frequently perceived as one of the most dangerous countries in the world, and corruption is endemic at all levels of power.

Since President Dilma Rousseff’s inauguration in January, no fewer than five senior government ministers have been forced to resign over accusations of ill-gotten gains, and the future of a sixth — Labor Minister Carlos Lupi — is currently in doubt.

The federal police force has also faced awkward questions, including two weeks ago when a group of serving and ex–police officers were caught trying to smuggle some of Rio de Janeiro’s most-wanted drug lords to safety in the trunk of a police car.

But while corruption is still rife, violent crime has fallen. Brazil’s Institute of Public Security reports that cases of lethal violence in the Rio de Janeiro state were down by 13.2% in the first seven months of this year compared with the same period last year.

At a total of 3,088 incidents, this still amounts to a frighteningly high level of lethal crime, when compared with the 337 murders recorded in the first half of this year in the New York State Crime Report. But it’s a step in the right direction.

The weight of the world

When asked about the shape of Brazil’s future, the New York Times’ Rohter commented, “Brazil has implemented some intelligent policies. It has also been very, very lucky.

“But nobody can be immune if the rest of the world is dragging you down,” he said.

“ ‘Nobody can be immune if the rest of the world is dragging you down.’ ” — Larry Rohter, New York Times

The Brazilian economy is beginning to feel the impact of the problems in the euro zone and North America, according to figures released by the Brazilian National Development Bank.

The bank is predicting that it will miss its lending targets by around $5 billion reals by the end of the year, indicating a significant slowdown in economic activity.

If these predictions come true, the drop in disbursements would represent the first annual decline since 2008, and some analysts have said the Brazilian economy is only likely to grow 3% this year, compared with 7.5% last year.

According to Joe Leahy of the Financial Times, one of the most significant effects of the crisis in the euro zone is likely to be a reduction in demand for Brazilian exports from Europe, which currently accounts for around 20% of Brazil’s international trade. He also cited a decline in capital flows as a major concern, considering that a third of Brazil’s direct-foreign-investment inflow over the past two years has come from Europe.

Rohter pointed to the triangular trade relationship among Brazil, China and the U.S. as a potential cause for concern. “Brazil supplies raw materials to China, which then creates the manufactured goods that the United States buys. So any kind of crisis or problem on the other two legs of that triangle could have a strong impact on Brazil,” he said.

But Brazil’s population of around 185 million, many of whom are just starting to make the most of the new prosperity initiated by the Plano Real, give the country’s economy buoyancy.

“Brazil is obviously in a favored situation compared to a country like Chile, which relies so much on foreign trade,” Rohter said.

Commodities are also well-diversified, ranging from coffee and soybeans to wood pulp, oil and minerals. Manufacturing strengths include aircraft made by Embraer ERJ, +2.79% and footwear, and exports are evenly balanced across most of the world’s major trading blocs, leaving Brazil in a strong position to resist economic threats from the outside.

The country survived the worst of the recession that started in 2008 largely thanks to this combination of a strong domestic market, diversified commodities and an even spread of trade worldwide. It is these same factors that Brazil will be relying upon to see it through this second wave of problems.

“Brazil is doing what it can to deal with the crisis,” Rousseff said last month while on a visit to Brussels. “Even with the crisis, Brazil keeps on growing.”