President Jair Bolsonaro will replace all three commanders of Brazil's armed forces, his government said Tuesday, the latest upheaval in Brasilia as the far-right leader braces against mounting criticism over an explosion of Covid-19 deaths.

The exit of the army, navy and air force chiefs came a day after Bolsonaro overhauled his cabinet, replacing the foreign, defense and justice ministers as well as his chief of staff, attorney general and government secretary.

Last week, he also installed his fourth health minister of the pandemic.

The turmoil comes as the government struggles to control a deadly surge of Covid-19 in Brazil, which has already killed more than 317,000 people in the country -- pushing many hospitals to the brink of collapse -- with a record of 3,780 deaths in the last 24 hours alone.

Bolsonaro, who comes up for re-election in October 2022, faces sliding popularity and growing pressure over his handling of the pandemic, including from key allies in Congress and the business world.

His attacks on lockdowns, face masks and vaccines have become fodder for critics, with Brazil ranking only behind the United States in terms of number of cases and fatalities.

The defense ministry did not give a reason for the departure of Army General Edson Pujol, Navy Admiral Ilques Barbosa and Air Force Lieutenant-Brigadier Antonio Carlos Bermudes.

Some Brazilian media reported the trio had resigned in protest at Bolsonaro's surprise decision to replace defense minister Fernando Azevedo.

"For the first time in history, the commanders of all three branches of the armed forces presented their joint resignation in disagreement with the president," said newspaper Folha de Sao Paulo.

Azevedo himself resigned because he was "uncomfortable with Bolsonaro's use of the military for political ends," journalist Merval Pereira wrote in newspaper Globo.

There were signs the armed forces commanders were uncomfortable, too, particularly Pujol.

He said last November the military "doesn't want to get involved in politics."

Brazilian President Jair Bolsonaro looks to be facing a tough electoral battle in 2022
Brazilian President Jair Bolsonaro looks to be facing a tough electoral battle in 2022 AFP / EVARISTO SA

The army chief had also called fighting Covid-19 "our generation's most important mission" and once shunned Bolsonaro's outstretched hand at an official ceremony, offering a socially distanced elbow bump instead.

Bolsonaro, a former army captain, frequently boasts of having the military's backing, and has packed his government with officers.

He is openly nostalgic for Brazil's 1964-1985 military dictatorship, despite its rights violations, including the kidnapping and torture of dissidents.

The armed forces have since carefully rebuilt an apolitical image of national service.

But Bolsonaro's hardline base has put that to the test with calls to reinstall military rule with him at the top -- talk the president is accused of fanning.

Bolsonaro's new defense minister, General Walter Braga Netto, said Tuesday the military dictatorship which took power on March 31, 1964, was something to be "celebrated."

"The Armed Forces assumed the responsibility of pacifying the country, taking on the burden of reorganizing it and guaranteeing the democratic freedoms that we enjoy today," he said.

There was no official word on the reasons for Azevedo's exit, but he said in a parting statement he was proud to have "preserved the armed forces as an institution of the state."

Vice President Hamilton Mourao, an army general, said there was "zero" risk of an anti-democratic intervention by the military against Congress or the courts.

"You can put whomever you like (as commanders), there will never be an institutional rupture. The armed forces will be on the side of legality, always," he said.

The military overhaul is part of the reform launched Monday by Bolsonaro, who last week appointed Marcelo Queiroga, a cardiologist, as the fourth health minister in a year.

Communications minister Fabio Faria told CNN Brazil that this is a "new moment" for the government and that Bolsonaro "resolved to move some pieces of the board," as "all governments" do mid-term.

The president looks to be facing a tough election battle in 2022, particularly after a Supreme Court justice earlier this month overturned former president Luiz Inacio Lula da Silva's corruption convictions, clearing the way for the leftist to mount a potential run against Bolsonaro.

Polls place the popular but controversial Lula, who was president from 2003-2010, neck and neck with Bolsonaro, at a time when the coalition that brought the president to power in January 2019 is badly frayed.