DILMA ROUSSEFF’S difficulties have been deepening for months. The massive scandal surrounding Petrobras, the state-controlled oil giant of which she was once chairman, has implicated some of the people closest to her. She presides over an economy suffering its worst recession since the 1930s, largely because of mistakes she made during her first term. Her political weakness has rendered her government almost powerless in the face of rising unemployment and falling living standards. Her approval ratings are barely in double digits and millions of Brazilians have taken to the streets to chant “Fora Dilma!”, or “Dilma out!”

And yet, until now, Brazil’s president could fairly claim that the legitimacy conferred by her re-election in 2014 was intact, and that none of the allegations made against her justified her impeachment. Like the judges and police who are pursuing some of the most senior figures in her Workers’ Party (PT), she could declare with a straight face her desire to see justice done.

Now she has cast away that raiment of credibility. On March 16th Ms Rousseff made the extraordinary decision to appoint her predecessor, Luiz Inácio Lula da Silva, to be her chief of staff. She portrayed this as a shrewd hire. Lula, as he is known to all, is a canny political operator: he could help the president survive Congress’s attempt to impeach her and perhaps even stabilise the economy.

But just days before, Lula had been briefly detained for questioning at the order of Sérgio Moro, the federal judge in charge of the Petrobras investigation (dubbed lava jato, or “car wash”), who suspects that the former president profited from the bribery scheme. Prosecutors in the state of São Paulo have accused Lula of hiding his ownership of a beach-front condominium. He denies these charges. By acquiring the rank of a government minister, Lula would have partial immunity: only the country’s supreme court could try him. In the event, a judge on the court has suspended his appointment.

This newspaper has long argued that either the judicial system or voters—not self-serving politicians trying to impeach her—should decide the president’s fate. But Ms Rousseff’s hiring of Lula looks like a crass attempt to thwart the course of justice. Even if that was not her intention, it would be its effect. This was the moment when the president chose the narrow interests of her political tribe over the rule of law. She has thus rendered herself unfit to remain president.

Three ways to leave the Planalto
 
How she exits the Planalto, the presidential palace, matters greatly. We continue to believe that, in the absence of proof of criminality, Ms Rousseff’s impeachment is unwarranted. The proceeding against her in Congress is based on unproven allegations that she used accounting trickery to hide the true size of the budget deficit in 2015. This looks like a pretext for ousting an unpopular president. The idea, put forward by the head of the impeachment committee, that congressmen deliberating Ms Rousseff’s fate will listen to “the street”, would set a worrying precedent. Representative democracies should not be governed by protests and opinion polls.

There are three ways of removing Ms Rousseff that rest on more legitimate foundations. The first would be to show that she obstructed the Petrobras investigation. Allegations by a PT senator that she did so may now form the basis of a second impeachment motion, but they are so far unproven and she denies them; Ms Rousseff’s attempt to shield Lula from prosecution may provide further grounds. A second option would be a decision by Brazil’s electoral court to call a new presidential election. It may do that, if it finds that her re-election campaign in 2014 was financed with bribes channelled through Petrobras executives. But this investigation will be drawn out. The quickest and best way for Ms Rousseff to leave the Planalto would be for her to resign before being pushed out.

Her departure would offer Brazil the chance of a fresh start. But the president’s resignation would not, of itself, solve Brazil’s many underlying problems. Her place would initially be taken by the vice-president, Michel Temer, leader of the Party of the Brazilian Democratic Movement. Mr Temer could head a national-unity government, including opposition parties, which, in theory, might be able to embark on the fiscal reforms needed to stabilise the economy and close a budget deficit that is close to 11% of GDP.

Sadly, Mr Temer’s party is as deeply enmeshed in the Petrobras scandal as the PT. Many politicians who would join a unity government, including some from the opposition, are popularly seen as representatives of a discredited ruling class. Of Congress’s 594 members, 352 face accusations of criminal wrongdoing. A new presidential election would give voters an opportunity to entrust reforms to a new leader. But even this would leave the rotten legislature in place until 2019.

The judiciary, too, has questions to answer. Judges deserve great credit for holding Brazil’s mightiest businessmen and politicians to account, but they have undermined their cause by flouting legal norms. The latest example is Mr Moro’s decision to release recorded telephone conversations between Lula and his associates, including Ms Rousseff. Most jurists believe that only the supreme court may divulge conversations in which one of the parties has legal immunity, as the president does. This does not justify the claim from government supporters that the judges are staging a “coup”. But it makes it easy for lava jato suspects to divert attention from their own misdeeds to the blunders of their pursuers.

Brazil’s war of parties and personalities obscures some of the most important lessons of the crisis.

Both the Petrobras scandal and the economic crash have their origins in misconceived laws and practices that are decades old. Getting Brazil out of its mess requires wholesale change: controlling public spending, including on pensions; overhauling growth-crushing tax and labour laws; and reforming a political system that encourages corruption and weakens political parties.

These can no longer be put off. Those chanting “Fora Dilma!” on the streets would claim victory if she was ousted. But for Brazil itself to win it would be just the first step.