LIMA, Peru—Were it not for a dizzying succession of corruption scandals, Brazilian President Luiz Inacio Lula da Silva would have been easily re-elected on Sunday. As usually happens when left-wing leaders adopt center-right policies in government, the space was too small for those attacking him either from the nostalgic left or the frustrated right. But corruption, a symptom of an institutional problem that Lula failed to address in his first term, forced the president into a runoff election later this month against the center-right former governor of Sao Paulo state, Geraldo Alckmin.

Lula is still the favorite in the second round. He has preserved most of his own political following because the more radical options from the left—led by Heloisa Helena, a Workers Party dissident—scare many people. And he has attracted part of the conservative vote because some middle-class Brazilians see in his government a better guarantee of social “containment” than the center-right alliance of the Brazilian Social Democratic Party and the Liberal Front Party can offer. Since Helena’s voters are more likely to support Lula than Alckmin, the president is expected to narrowly win re-election.

The governing Workers Party won only four governorships, out of 27. Sao Paulo, the giant state that is also the industrial heart of the country, is solidly in the hands of the opposition. In the outgoing Chamber of Deputies, Lula and his allies were 10 votes short of a majority. Now, thanks to the corruption scandals, his position will be much weaker. In Brazil’s labyrinthine political system, where governors have great power over legislators because they control local tax collection and Congress is endemically fragmented, this will translate into immobility and acrimony in the next several years.

It’s bad news for whoever wins in the second round. Brazil urgently needs changes: The economy is plodding on when compared with many other “emerging” countries, and poverty has declined barely 1 percent since 2002. The suffocating state system is fostering corruption.

Last year, the economy grew 2.6 percent; this year’s growth will not exceed 3 percent. According to the Institute for Applied Economic Research, there are almost 54 million poor Brazilians, half of whom are indigent. Lula’s “Family Budget” program—part of the “Zero Hunger” aid scheme—gives $24 a month to more than 11 million families, provided they send their children to school and have them vaccinated. Were it not for this non-productive aid, the government could not boast of having lifted 6 million Brazilians out of poverty. Clearly, this is a minor achievement in comparison with the accomplishments of China, India and South Africa—Brazil’s “emerging” counterparts.

Because Brazil’s political system makes it devilishly difficult to make decisions and its state system greatly limits the creation of wealth (some companies must pay as many as 61 different taxes), corruption has proliferated spectacularly. A deputy allied with Lula disclosed that in 2005 he had received bribes for his votes in Congress, as had other legislators. It was the tip of an interminable skein. The country uncovered a systematic scheme involving the purchase of legislative votes, the illegal bankrolling of parties, and entrepreneurial bribery that blanketed much of the so-called political class. Lula mounted a comeback after looking politically finished, thanks partly to the fact that Congress—and his compatriots—pardoned him. But the origin of the problem remains, eroding the people’s confidence in their institutions.

In Latin America as a whole, Lula should have represented a boost to the modernization of the left, but because his government maintains a foreign policy out of tune with his management of domestic affairs, the opposite has happened. Former President Fernando Henrique Cardoso told me that Lula’s “rhetorical and contradictory leadership” has helped demagogic leaders gain space. The loose alliance his government (to a great degree under the guidance of his adviser Marco Aurelio Garcia) has forged with Hugo Chavez has reinforced the Venezuelan’s position. Brazil has pledged to support Venezuela in its quest for a seat on the U.N. Security Council and is backing the grandiose Venezuelan project to run an 8,000-kilometer natural gas pipeline through Amazonia.

Lula’s bet on keeping the Mercosur trading bloc away from any increased commercial ties with the United States or other prosperous regions shows the degree to which his foreign policy clings to the old Latin American habits, even if Lula eschews the demagogical stridencies of his Bolivarian neighbor. Lula’s probable re-election a month from now guarantees that for the next few years, Latin America will lurch about on half its cylinders.