Brazil's economy is picking up, thanks largely to exports bound for China. And that's good news for a leftist President with a fiscally conservative agenda.

(FORTUNE Magazine) – A wicked sun beats down on the balding head of Iran Auzier, a 57-year-old electrician finishing a wiring job at a boatyard on Brazil's Rio Negro. Like everyone else toiling here in the red dust, Auzier works hard for little pay. "There's not much opportunity," he says. "Just a few people get most of the money, and the money we do get doesn't go very far."

The boat Auzier is working on will be delivered to Moacir Fortes, a Brazilian who started out taking Americans and Germans on canoe trips into the Amazon jungle. Now he owns three triple-deck tour boats and will soon launch a fourth. Fortes would still be paddling his canoe were it not for a Texas investor who funded the operation: Interest rates in Brazil are running at 16.25%, and entrepreneurs like Fortes have to pay annual rates up to 100%--if they can get a loan at all. "I couldn't even dream of making a profit," he says. "The big problem in Brazil is the cost of money."

A few hundred miles upriver, Darci Batista Nogueria, mother of five, putt-putts from village to village in a rickety motorboat. Trained as a wound-stitcher and earning the minimum wage of $86 a month, she represents the entire medical system for the far-flung villages of her region. Serious emergencies and ailments require a 12-hour canoe ride to the nearest doctor. Brazil's biggest problem, she says, is the "disastrous" state of health care.

Deep poverty, gross inequality, staggering debt, crippling interest rates, high unemployment, crumbling ports and roadways, horrendous crime--there is no shortage of problems in Brazil. What is different now is that this vast, energetic nation blessed with resources has been dealt its best chance in decades to begin reaching its potential and climb into the ranks of the world's most developed nations. The global boom in commodities has given the two-year-old government of President Luiz Inácio "Lula" da Silva enough ballast to embark on an approach considered unusual in much of Latin America: straightforward economics.

In contrast with Argentina, which continues to stiff private bondholders, or Venezuela, where President Hugo Chávez hasn't articulated a long-term plan for development beyond spending oil revenue as fast as it gushes in, the ostensibly leftist Lula government has earned worldwide respect for its sensible if politically difficult economic program.

The plan sounds like a corporate restructuring: Cut spending, pay down debt, trim the bureaucracy, give the innovators room to roam. By stabilizing the economy and reforming business laws, Lula hopes to bring down interest rates for entrepreneurs like Fortes, create more jobs at better wages for workers like Auzier, and generate more tax revenue for social spending on health care and education to produce a more competitive workforce. That in turn will expand consumption by Brazil's 184 million inhabitants.

After a year of hardly any growth at all, the economy is gaining traction. Foreign trade leads the way. From steamy Manaus on the Amazon to Pôrto Alegre in the temperate south, Brazil is pumping out commodities at a record rate--beef, chicken, soybeans, wood, copper, iron ore--much of it headed to China, where exports from Brazil ballooned 80% last year. Total exports grew 21% in 2003 and are expected to jump 23% this year, to a record $90 billion.

Industrial output is picking up too. Pigiron foundries, food processors, and truckmakers can barely keep up with demand. The government has opened hundreds of oilfields to private development. Samsung plans to double cellphone production. GDP growth is expected to hit 4% this year. And unemployment, still high at 11.4%, is down from 13.1% in April.

By itself, an economic boomlet says little about the long-term health of a country. But Brazil's charismatic, working-class President intends to buck history. Says Finance Minister Antonio Palocci: "We're not interested in short-term measures meant only to get people's approval. We're setting the conditions for long-term economic growth." To do this, the government has paid a high price. Spending cuts caused the economy to shrink in 2003 and Lula's approval ratings to plunge (they've since begun climbing back up).

For decades Brazil has lurched from democracy to dictatorship and back, all the while experimenting with a variety of unorthodox economic schemes that guaranteed its exclusion from the ranks of the world's developed nations. Banning foreign imports of hardware and software at the start of the PC era failed to spark a home-grown industry; instead it encouraged a flood of illegal equipment and pirated software. In 1990 one of the first acts of conservative President Fernando Collor de Mello (who later resigned) was to freeze everyone's bank account. That sparked financial chaos, and after the freeze was lifted, inflation hit 2,477%. Fernando Henrique Cardoso, a centrist President, crushed inflation by creating a new currency in the 1990s but also larded on more foreign debt, to the point that external borrowings totaled 36% of GDP.

Lula's first economic move was the appointment of a FleetBoston executive to head the central bank. It was a bold signal that marked the start of a strict austerity campaign, aimed at paying down the nation's debt and freeing up investment to spur growth. Social spending was constrained by a $14 billion emergency loan from the International Monetary Fund, arranged by the previous administration, which required that Brazil run a 3.75% domestic budget surplus to guarantee swift payback. Lula raised that figure, now at 4.5%. He cut federal spending, laid off government employees, and closed ministries. He pushed a pension-reform plan through Congress that cut benefits to federal workers, one of his most loyal constituencies.

The result: outrage. "It was not just daring but audacious to go after the public employees," says David Fleischer, a political scientist at the University of Brasília. "They said, 'This is our guy, and he's coming after us with a two-foot knife!'" Yet a country can't pay down debt without controlling public spending, and in Brazil, Fleischer says, "The left gets to do things that the conservatives were never able to do."

Lula is Portuguese for "squid," the nickname he earned in his youth for the tendrils of curly black hair bursting atop his then-skinny physique. Lula grew up poor. He shined shoes and sold peanuts at the São Paulo train station to help his family survive. He quit school for a factory job and in his teens became a machinist, the top of the blue-collar heap. Later he helped form a new autoworkers' union, whose strikes contributed to the downfall of the military regime in 1985, and the Workers Party, a diverse group that includes hard leftists and moderate reformers. Lula's position is hinted at in a 1990s documentary, in which he spoke not about a rising proletariat but about the bad economy's effect on consumer spending. An autoworker used to make enough money, he said, "to live in a nice house. He could buy a little car, he could eat out on weekends, he and his wife could go to the supermarket to fill up the fridge. The worker who one day was living well and began to lose that--of course he would rebel."

An advocate for the poor and hungry, Lula, now 58, has appropriated $1.5 billion so far to fund Zero Hunger, which aims to provide every Brazilian three meals a day through distribution of surplus food and transfer payments of up to $30 a month per family. But additional social investment will require debt reduction. Debt payments steer money away from hiring teachers, equipping nurses, and building schools and roads. High debt levels ratchet up what investors call "country risk," which translates into high interest rates, slow economic growth, and limited tax revenue.

Some of Lula's harshest critics call him a tool of international capitalism and insist he just say no to the debt. That's not an option--it would shut off Brazil from new financing and could send South America into turmoil. The only realistic choices are to keep borrowing, with severe limits on economic growth, or to bite the bullet and bring debt down. This year Brazil will pay off the emergency IMF loan with no plan to renew it. It has also reduced external debt levels from 36% of GDP to 29%.

The export boom is what's allowing the Lula government to fix its finances without choking growth. But the plan could falter if exports sink, after, say, a bust in China. So Brazil is busy trying to expand its markets around the world. No Brazilian President in modern times has been as aggressive on the trade front as Lula. While some mutter that their President spends too much time out of the country, he's busy globetrotting from China to Africa to the U.S. to Europe seeking buyers for Brazilian products and investors for companies and infrastructure projects at home.

Drawing on his union leader skills, Lula was instrumental in creating the G-20, a group of developing nations that includes China, India, and South Africa. At World Trade Organization talks in August, under pressure from the G-20, the U.S. and Europe agreed that agricultural subsidies kept world prices artificially low and needed to be phased out--a watershed event for the developing world. Brazil has also won major WTO disputes over cotton subsidies in the U.S. and sugar subsidies in Europe.

"We should do what the Americans do," Lula says, sitting in his office in Brasília. "Americans believe in themselves. When they perceive that we are not dependent on them but have other alternatives, some flexibility can come into the picture of negotiations. No one respects someone who doesn't respect himself."

Respect is a touchy issue in Brazil. The country has long felt slighted by the U.S. In 1939, FORTUNE quoted Brazil's Foreign Minister joking to a Washington, D.C., audience that he planned to erect a statue of Adolf Hitler back home. "For it is Hitler," the Foreign Minister said, "who has at last succeeded in drawing the attention of the United States to Brazil." Then the U.S. needed Amazon rubber and access to Brazilian ports. Now it wants trade accords.

Lula's newfound place on the world stage helps him at home--and he needs all the help he can get. The Workers Party scored big victories in nationwide municipal elections Oct. 3, but in the mayoral runoff in São Paulo on Oct. 31, the Workers Party incumbent is in danger of losing to Lula foe José Serra. Meanwhile, inflation is expected to reach 7% this year. Interest rates could head up. And Congress may resist Lula's next round of reforms, especially bills aimed at curbing corruption and modernizing the judiciary. Still, Lula says, "the worst is over."

If things go well, Brazil could emerge as one of the world's top economies, according to a Goldman Sachs report on the so-called BRIC countries--Brazil, Russia, India, and China. The report predicts that the four could surpass the major industrial powers over the next 40 years. That would please João Cayres, a union leader at a Ford plant near São Paulo. Asked recently at a conference in Berkeley why Lula wasn't campaigning to spread unions into more industries, he responded, "The best thing for unions is to create more jobs. If Lula doesn't do it, no one will."