Brazil is in tatters. The economy is in a deepening recession: Last Tuesday, Moody’s downgraded Brazil’s credit rating to just about junk. A massive corruption scandal involving the national oil company Petrobras has ensnared scores of politicians and businessmen. The legislature is in revolt. President Dilma Rousseff’s popularity rating, less than a year after her re-election, is down to one digit, and nationwide protests on Sunday reverberated with calls for her impeachment.

In all this turbulence, it is easy to miss the good news: the fortitude of Brazil’s democratic institutions. In pursuing bribery at Petrobras, federal prosecutors from a special anticorruption unit of the Public Ministry have not been deterred by rank or power, dealing a blow to the entrenched culture of immunity among government and business elites. Former Petrobras executives have been arrested; the wealthy chief executive of the construction giant Odebrecht, Marcelo Odebrecht, is under arrest; the admiral who oversaw Brazil’s secret nuclear program has been arrested, and many others face scrutiny, including Ms. Rousseff’s predecessor and mentor, Luiz Inácio Lula da Silva.

Though the investigations have created huge political problems for Ms. Rousseff and have raised questions about her seven-year tenure as the chairwoman of Petrobras, before she became president, she has admirably made no effort to constrain or influence the investigations. On the contrary, she has consistently emphasized that no one is above the law, and has supported a new term for the prosecutor general in charge of the Petrobras probe, Rodrigo Janot.

So far, the investigations have found no evidence of illegal actions on her part. And while she is no doubt responsible for policies and much of the mismanagement that have laid Brazil’s economy low, these are not impeachable offenses. Forcing Ms. Rousseff out of office without any concrete evidence of wrongdoing would do serious damage to a democracy that has been gaining strength for 30 years without any balancing benefit. And there is nothing to suggest that any leaders in the wings would do a better job with the economy.