BRAZIL’S Congress has witnessed some bizarre scenes in its time. In 1963 a senator aimed a gun at his arch-enemy and killed another senator by mistake. In 1998 a crucial government bill failed when a congressman pushed the wrong button on his electronic voting device. But the spectacle in the lower house on April 17th surely counts among the oddest. One by one, 511 deputies filed towards a crowded microphone and, in ten-second bursts broadcast to a rapt nation, voted on the impeachment of the president, Dilma Rousseff. Some were draped in Brazilian flags. One launched a confetti rocket. Many gushed dedications to their home towns, religions, pet causes—and even Brazil’s insurance brokers. The motion to forward charges against Ms Rousseff to the Senate for trial passed by 367 votes to 137, with seven abstentions.

The vote comes at a desperate time. Brazil is struggling with its worst recession since the 1930s.

GDP is expected to shrink by 9% from the second quarter of 2014, when the recession started, to the end of this year. Inflation and the unemployment rate are both around 10%.

The failure is not only of Ms Rousseff’s making. The entire political class has let the country down through a mix of negligence and corruption. Brazil’s leaders will not win back the respect of its citizens or overcome the economy’s problems unless there is a thorough clean-up.

Ditching Dilma
Sunday’s vote was not the end of Ms Rousseff, but her departure cannot now be far off. Brazil ought not to mourn her. Incompetence in her first term in office, from 2011 to 2014, has made the country’s economic plight incomparably worse. Her Workers’ Party (PT) is a prime mover behind a gargantuan bribery scheme centred on Petrobras, the state-controlled oil company, which channelled money from contractors to politicians and parties. Although Ms Rousseff has not been personally implicated in the wrongdoing, she tried to shield her predecessor as president, Luiz Inácio Lula da Silva, from prosecution.

What is alarming is that those who are working for her removal are in many ways worse. If the Senate votes to put her on trial, probably by mid-May, Ms Rousseff will have to step aside for up to 180 days. The vice-president, Michel Temer, who comes from a different party, will take over and serve out her term if the Senate removes her from office. Mr Temer may provide short-term economic relief. Unlike the hapless Ms Rousseff, he knows how to get things done in Brasília and his Party of the Brazilian Democratic Movement (PMDB) is friendlier to business than the PT.

But the PMDB is hopelessly compromised, too. One of its leaders is the speaker of the lower house, Eduardo Cunha, who presided over Sunday’s six-hour impeachment spectacle and has himself been charged by the supreme court with taking bribes through the Petrobras scheme.

In announcing their “no” votes, some of Ms Rousseff’s allies denounced Mr Cunha as a “gangster” and a “thief”.

The taint of corruption is spread across many Brazilian parties. Of the 21 deputies under investigation in the Petrobras affair, 16 voted for Ms Rousseff’s impeachment. About 60% of congressmen face accusations of criminal wrongdoing.

There are no quick ways of putting this right. The roots of Brazil’s political dysfunction go back to the slave-based economy of the 19th century, to dictatorship in the 20th and to a flawed electoral system that both makes campaigns ruinously expensive and also shields politicians from account.

In the short run, impeachment will not fix this. The charge that is the basis for trying Ms Rousseff—that she manipulated accounts last year to make the fiscal deficit look smaller than it was—is so minor that just a handful of congressmen bothered to mention it in their ten-second tirades. If Ms Rousseff is ousted on a technicality, Mr Temer will struggle to be seen as a legitimate president by the large minority of Brazilians who still back Ms Rousseff.

In any other country, such a cocktail of economic decline and political conflict might be combustible. Yet Brazil has remarkable reserves of tolerance. Divided as they are over the rights and wrongs of impeachment, Brazilians have kept their anger in check. The past three decades suggest that theirs is a country which can endure a crisis without resorting to coups or collapses. And here, perhaps, is a shred of hope.

The fact that the Petrobras scandal has ensnared some of the country’s most powerful politicians and businessmen is a sign that some institutions, especially those that enforce the law, are maturing. One reason politicians are in such trouble is that a new, better-educated and more assertive middle class refused to put up with their impunity. Some of the statutes now being used to put away miscreants were enacted by Ms Rousseff’s government.

One way of capturing this spirit would be for the country to hold fresh elections. A new president might have a mandate to embark on reforms that have eluded governments for decades. Voters also deserve a chance to rid themselves of the entire corruption-infested Congress. Only new leaders and new legislators can undertake the fundamental reforms that Brazil needs, in particular an overhaul of the corruption-prone political system and of uncontrolled public spending, which pushes up debt and hobbles growth.

Second best
True enough, the path to renewal through the ballot box is strewn with obstacles. Given its record, Congress is unlikely to pass the constitutional amendment required to dissolve itself and hold an early general election. The electoral tribunal could order a new presidential ballot, on the ground that Petrobras bribe money helped finance the re-election of Ms Rousseff and Mr Temer in 2014. But that is far from certain.

There is thus a good chance that Brazil will be condemned to muddle on under the current generation of discredited leaders. Its voters should not forget this moment. Because, in the end, they will have a chance to go to the polls—and they should use it to vote for something better.