F ROM THE viewpoint of Jair Bolsonaro, Brazil’s president-elect, it was an inspired appointment. On November 1st he announced that Sérgio Moro, the most prominent judge in the long-running corruption investigation known as Lava Jato (Car Wash), had agreed to serve as his justice and security minister. “His anti-corruption, anti-organised-crime agenda, as well as his respect for the constitution and the laws, will set our course,” Mr Bolsonaro tweeted. But there is a snag in Mr Moro’s appointment. It appears to confirm the claims of the left-wing Workers’ Party ( PT ) that the judge’s motive earlier this year for jailing its leader and putative presidential candidate, Luiz Inácio Lula da Silva, was more political than judicial.

Whether or not that is true, Mr Moro’s new job (which he will take up on January 1st) is only the most dramatic example of an increasingly activist judiciary playing a more political role in Latin America. In Peru on October 31st, Judge Richard Concepción sent Keiko Fujimori, the leader of the opposition, to jail for three years without charge while he investigates claims that she received $1m for her presidential campaign in 2011 from Odebrecht, a Brazilian construction company. Her supporters say the judge is in cahoots with the government.

Many see such cases as an overdue clean-up of Latin American political life by newly emboldened judges and prosecutors. The powerful, be they politicians or businessmen, historically had little to fear from a biddable judiciary. Citizens now know much more about corruption and are much less tolerant of it. Anger at the PT and its attempt to game the political system through graft was a big factor in the unlikely victory of Mr Bolsonaro, a far-right former army captain. Tarred in the minds of many Peruvians because her father ruled as an autocrat, Ms Fujimori has played a destructive role in the country’s politics, organising the censure by congress of competent ministers.

Yet there are risks. José Domingo Pérez, the prosecutor in Ms Fujimori’s case, claims that she headed a “criminal organisation” within Popular Force ( FP ), her party, which “laundered” the Odebrecht money by registering fake donations. If true, this was a breach of political financing rules. But was it a crime? There is no evidence that Ms Fujimori, who lost in 2011 and 2016, offered padded contracts to Odebrecht. Mr Pérez claimed that if free she might destroy evidence (though she had not done so previously).

When Miguel Torres, an FP congressman, complained that “they have taken away [Ms Fujimori’s] right to an impartial judge, due process and the presumption of innocence”, he had a point. Happiest about all this will be Alejandro Toledo, a former Peruvian president, who is accused of taking $20m in bribes (which he denies). His lawyers have new arguments to resist his extradition from the United States.

As for Mr Moro, some of his judicial acts now look questionable. Lula was leading the opinion polls when he was jailed. The sentence—of more than nine years for receiving a flat worth $600,000—looked disproportionate. Days before the election, Mr Moro released plea-bargaining testimony from Antonio Palocci, a former PT minister, which incriminated the party. It now transpires that Mr Moro was already talking to Mr Bolsonaro’s people. All this undermines trust.

Mr Moro said his appointment “means consolidating the progress against crime and corruption of recent years and preventing risks of backsliding”. That is possible. He may also restrain Mr Bolsonaro in his policy of egging on police to shoot criminals.

But Mr Moro had insisted that he would never enter politics. How his breaking of that pledge comes to be viewed depends not just on how successful he is in his new role, but also on whether judges and prosecutors pursue wrongdoers in parties allied with the government as vigorously as he did Lula.

Whereas corruption remains largely unpunished in places like Mexico and Argentina, Brazil and Peru have gone furthest in investigating the sprawling Odebrecht scandal. There are some safeguards in both countries. Lula’s conviction was upheld by an appeal court (which increased his sentence), and his case will reach the supreme court. Peru’s constitutional tribunal this year freed Ollanta Humala, yet another former president, and his wife from what it said were “arbitrary detentions” without charge by Mr Concepción. Holding the powerful to account is a step forward, but justice must be seen to be fair.