Brazil seems to be engaged in inverting Karl Marx’s famous dictum about history repeating itself, first as tragedy then as farce.

Thirty years ago it elected the little-know governor of one of the country’s most backward states as president. Fernando Collor ran as the scourge of the pampered “maharajas” of the public sector who lived high on the hog at taxpayers’ expense.

The fact that during the 1989 election campaign several journalists exposed this lie by detailing Collor’s own corruption made little impact as he became the establishment’s vehicle for preventing the left-wing Workers Party seizing power.

Now three decades later the country is beginning to discover that in plucking another supposed anti-corruption zealot from political obscurity to become president it has repeated the mistake.

Brazilian president Jair Bolsonaro speaks to army general Luiz Eduardo Ramos Baptista Pereira: the generals have been serially humiliated by the president and his sons. Photograph: Fernando Souza/AFP/Getty

Jair Bolsonaro might have found himself under the spotlight at this weekend’s G7 summit because of international alarm at a spike in fires in the Amazon, linked to his administration’s disdain for environmental controls.

But it is the new president’s increasingly alarming approach towards institutions under his command responsible for combating corruption that is causing growing disquiet across Brazil’s state apparatus.

Those who voted for Bolsonaro cannot say they were not warned. In one of the presidential debates last year left-wing candidate Guilherme Boulos pointedly asked Bolsonaro, “who’s Wal?” The answer was a woman who sells bowls of açaí from her humble shop on the Rio coastline who was also employed as a member of Mr Bolsonaro’s congressional staff, despite no evidence she ever worked in Brasília.

He rather lamely said her duties involved looking after the dogs at his summer house, further reinforcing suspicions the far-right candidate engaged in one of the basest practices of Brazil’s fetid political swamp – employing phantom staff so as to pocket their taxpayer-bankrolled salaries.

But once again a majority of Brazilian voters were prepared to look the other way, especially as Bolsonaro had skilfully positioned himself as the best bet for preventing the Workers Party from returning to power.

Despite growing institutional push-back Bolsonaro seems determined to continue his offensive against the state’s organs of control

The consequences of doing so are now becoming increasingly clear as, now ensconced in the presidency, Bolsonaro wages campaigns against state institutions tasked with combating corruption.

In recent weeks he has orchestrated the removal of the head of the federal agency that monitors suspicious financial transactions, known as Coaf, and which is the starting point for so many of the country’s corruption investigations. The fired man’s crime seems to have been his rigour in tackling wrongdoing.

Bolsonaro’s political interference has also provoked unrest in the upper echelons of the federal revenue service after he sacked its number two in another offensive against an institution involved in combating corruption.

Most dramatically federal police chiefs threatened to resign on mass following the president’s dramatic ouster of Ricardo Saadi, the head of its regional office in Rio de Janeiro and his attempt to impose his own candidate as Saadi’s replacement rather than that of his justice minister, Sérgio Moro.

The common theme that seems to connect these various conflicts is the fact the three institutions targeted by the president are all in one way or another linked to investigations involving the Bolsonaro family, more specifically his son Flávio.

It was data from Coaf that launched the investigation into the now federal senator. He faces accusations that during his 16 years as a deputy in Rio state assembly he pocketed part of the salaries of dozens of his staff.

The president’s public declarations betray a nervousness that the investigation into Flávio’s activities as well as exposing his corruption could flesh out the Bolsonaro family’s alleged links to Rio’s murderous criminal militias formed by serving and former police officers.

Bolsonaro eulogises South America’s former military dictatorships and has eagerly signed up for the hard-right kulturkampf

Flávio was a vocal supporter of the militias and employed the mother and wife of one of their leaders suspected of involvement in the murder of Rio city Cllr Marielle Franco.

Despite growing institutional push-back Bolsonaro seems determined to continue his offensive against the state’s organs of control. The next front in this war is set to be his appointment of a new head for the federal prosecution service. The position is one of the most sensitive in the country, coming as it does with the responsibility to investigate and prosecute politicians for wrongdoing. Among the cases to pass across the current incumbent’s desk is that of Wal.

Normally, federal prosecutors are polled on their choice for the job and the president appoints a name from the list of the highest-polling candidates. But Bolsonaro is threatening to dispense with that convention and instead nominate Antonio Carlos Martins Soares, a prosecutor with little support among his peers.

Resistance

Author of an essay titled The Farse of Democracy, he was once charged with forging a signature but managed to kick the case into the long grass until it fell foul of the statute of limitations. He also contested efforts to make him repay salary he received in error during a leave of absence. The fear is such an appointment will signal the end of the federal prosecution service as a frontline force in the battle against political corruption.

Resistance to Soares has forced Bolsonaro to delay any announcement and he runs the risk that picking so many fights with anti-corruption bodies will rebound on him. These after all are the agencies that know where many of the political world’s metaphorical bodies are buried.

And a recent string of scandals already indicate Bolsonaro’s nominally anti-graft administration has much to hide, even if any have yet to gain traction. Much more dirt could still be thrown in Bolsonaro’s fight with the anti-corruption bodies under his command.

Facing impeachment, Collor resigned as president in 1992, bundled out of power after the full extent of his administration’s misconduct was exposed. In retrospect he was little more than a spoiled son of Brazil’s traditional political oligarchy.

He seemed to believe politics owed him after a lonely childhood in Brasília being served dinner by white-gloved waiters while his politician father was often absent. Essentially harmless he was later allowed back into politics, now sitting as an eccentric though still ethically challenged senator.

Bolsonaro represents something different. He disdains Brazil’s democratic settlement, eulogises South America’s former military dictatorships and has eagerly signed up for the hard-right kulturkampf now being waged across much of the western world.

And it is noticeable that the accumulation of evidence exposing the president’s anti-corruption stance as a lie is accompanied by the Bolsonaros amping up the ideological stridency that plays so well with their hardcore supporters.

The cynicism of this strategy seems clear though its consequences are unpredictable. Farce, then tragedy.

Tom Hennigan is based in São Paulo and writes on South America for The Irish Times