South America is a vast continent of light, yet it has a dark soul. Nestled in its political class, like a snake from the rain forest, corruption poisons the core of government.

South America is a vast continent of light, yet it has a dark soul. Nestled in its political class, like a snake from the rain forest, corruption poisons the core of government.

Badly needed resources are siphoned from public purposes to run the machinery of political parties. Pervasive and systemic, corruption is sanctioned by a culture of impunity from the top.

Until recently, this shield from prying eyes has been particularly strong in the economic powerhouses of Brazil and Argentina — though that may be changing. Lately, especially in Brazil, high public officials accused of corruption have been paraded almost daily through the media and the courts.

On the index of shame maintained by the Berlin-based corruption monitoring group Transparency International, Argentina places with worse than averagely corrupt states like Niger and Djibouti. Brazil scores better, alongside Italy and Greece, while Venezuela ranks among the worst, close to Somalia and North Korea.

Brazil’s place as the third most honest nation in South America, after Chile and Uruguay, is small comfort for its embattled president, Dilma Rousseff. With growing evidence of her government’s egregious graft, she is clinging to political survival by her fingernails.

“What we’re seeing is not the failure of democracy in Brazil, it’s democracy at work,” said Matias Spektor, a professor of international relations at the Getulio Vargas Foundation in São Paulo. Professor Spektor is writing a book on the presidency of Luiz Inácio Lula da Silva, often known simply as Lula, Ms. Rousseff’s mentor and predecessor. His reputation was already shredded by the Godzilla-size vote-buying scheme uncovered during his presidency.

Unlike Argentina, where the judicial branch is slow to the point of ossification, the judicial officials probing corruption in Brazil are vigorous and fearless. These young specialists in financial crimes, with doctorates from Harvard and the London School of Economics, have called their probe “Operation Carwash,” after a surveillance operation on the owner of a gas station exposed the money-laundering business. At the heart of this scheme were contracts involving Petrobras, Brazil’s part-public oil giant, the largest company in Latin America, in which about $3 billion was paid in bribes and kickbacks.

When dozens of senior politicians were implicated in the Petrobras scandal in March, hundreds of thousands of angry Brazilians took to the streets in protest. Despite Ms. Rousseff’s being cleared by a parliamentary inquiry, many find it hard to believe she was unaware of the vast scam: She was on the Petrobras board of directors for seven years until 2010.

The “Carwash” investigation followed from the “Mensalão” scandal during Mr. da Silva’s presidency. His former cabinet chief José Dirceu received a prison sentence of nearly eight years for his part in the complex bribery network that paid legislators about $12,000 a month to vote with the government (mensalão means “big monthly payment” in Portuguese). Mr. da Silva has denied any involvement in the scheme.

“Brazil’s political system is polarized, we have 30 parties in Congress, so whoever governs needs to put together a coalition,” said Professor Spektor. “But how do you glue together those small parties on the right and the left? There’s no ideological coherence. So the glue to keep them together is money.”

In Argentina, corruption is not only more deeply ingrained but is also more difficult to prosecute. Unlike Brazil, where scores of corrupt officials are behind bars, hardly anyone goes to jail here.

“If you are unlucky enough to be caught, you might have to trundle through the courts for 10 years,” said Hugo Alconada Mon, an investigative journalist, “but the case will eventually be thrown out and you’ll get to keep the money.” According to one study, only 3 percent of 750 major corruption cases, involving some $13 billion, have ever resulted in convictions.

“The difference with Argentina is that in Brazil the judges are truly independent,” said Luis Moreno Ocampo, an Argentine lawyer who made his name in 1985 as a young prosecutor in Argentina’s historic “Trial of the Juntas” against the leaders of the country’s bloody 1976-83 military dictatorship.

In the 1990s, Mr. Moreno Ocampo set up a practice that served pro bono in lawsuits involving political corruption, but he was swimming against the tide. On one occasion, when the press asked the president at the time, Carlos Menem, about a Ferrari sports car he had accepted from an Italian businessman, Mr. Menem protested, “It’s mine, mine, mine.”

“The attempt to continue the trial against the juntas with trials against corruption only made Menem react by putting in judges who responded to his orders,” said Mr. Moreno Ocampo. Thwarted in the fight against corruption in Argentina, he left to become the first prosecutor of the International Criminal Court in The Hague.

The system remained in place during the presidency of Cristina Fernández de Kirchner, whose term ended this month. Her presidency, too, was far from immune to controversy, ranging from her vice president’s being charged with corruption in connection with the government’s takeover of a currency printing facility to speculation about her own business affairs.

The industrial scale of corruption in South America is not simply the result of politicians taking bribes for personal gain; rather, it has often been a principal means of financing for the continent’s largest political parties — Ms. Rousseff’s Workers’ Party in Brazil, and the splintered but still powerful Peronist movement in Argentina. A system so entrenched in the continent’s political cultures is, naturally, very difficult to dismantle.

“Argentina needs to pursue corruption with the same determination with which it put its human rights crimes on trial,” said Robert Cox, a British journalist who reported on the military dictatorship.

Argentina’s new president, Mauricio Macri, has vowed to stamp out corruption. It is not clear yet, however, whether he can mobilize the resolve and deliver on that promise.