“I will not resign. Oust me if you want,” Michel Temer said this week. Brazilians would like to take the president at his word. After three years of political turmoil and public disgust, the “Carwash” investigation into corruption that involved some of the country’s biggest companies and a frightening number of its politicians was under growing pressure; some feared it was being neutered. Then came explosive allegations that a secret tape captured Mr Temer discussing hush-money. His ratings had fallen to single figures even before these latest claims. Now Brazil’s top prosecutor has formally accused him of conspiring to silence witnesses and obstruct a corruption investigation; and he has dropped a legal bid to have the case suspended.

Mr Temer denies wrongdoing, insisting the recording has been doctored, and says stepping down would be an admission of guilt. Other considerations are no doubt weighing on his mind – notably that he would lose legal protections. As president, impeachment would require approval by Congress to proceed, and he cannot be charged over allegations that precede his time in office. Support within his Brazilian Democratic Party and coalition is crumbling. Allies can see the attractions of letting him take the flak for weakening the Carwash inquiry, and handle a case beginning next month in the supreme electoral court, which could annul the 2014 election. But even so, Brazil could soon have its third leader in under a year.

Brazilian politics have been thoroughly discredited. The revelations that have emerged since Dilma Rousseff was forced out last year have highlighted the hypocrisy of those who brought her down. Though Ms Rousseff was impeached on separate charges, and appeared relatively clean herself, the anger against her was fuelled by revelations about her Workers’ Party. In March, the chief orchestrator of her impeachment, Eduardo Cunha, was jailed for more than 15 years in relation to a $1.6m bribe. The tape of Mr Temer, who was her deputy but was believed to be plotting against her in the later stages of the scandal, allegedly captures him approving cash payments to Mr Cunha.

By taking on such a powerful centre-right figure, the attorney-general Rodrigo Janot has shown he cannot be cowed and put paid to claims that Carwash has been politically partial. When his term ends this autumn, whoever is president should agree – as when Mr Janot was chosen – that they will abide by the outcome of a poll of public prosecutors, depoliticising the contest.

But many legislators have secrets of their own to hide, and some are already complaining that the investigation has been bad for Brazil’s reputation and economy. There is a danger they will try to fudge their way out, perhaps by persuading the president to quit. But the problem is the scandal, not the inquiry, and Brazil will do much worse if it is suppressed. Nor should legislators choose Mr Temer’s replacement, for it was they who picked him, and polls show overwhelming demand for an election. An already disenchanted public may otherwise sink into apathy or in the longer run, turn to an authoritarian, far-right figure such as Jair Bolsonaro playing the anti-politics card. Brazil’s politicians got the country into this mess: they should let the 143 million voters have a say in how to get out of it.