Faced with his biggest political and public health crises yet, Brazil’s far-right president Jair Bolsonaro has tried to assert his authority by reshuffling the cabinet and switching military chiefs, but the changes have only underlined his ebbing support.

Bolsonaro has come under intense pressure from the political and business elite to abandon his opposition to vaccinations, lockdowns and mask-wearing, as coronavirus deaths climb in a country where inoculations have been slow to gather pace.

Brazil is now reporting more new coronavirus cases than any other country in the world. Its death toll of more than 310,000 is surpassed only by the US, and on Tuesday Covid-19 fatalities hit a new one-day record of 3,780. The country has administered just 17.7m vaccine doses, or 8.4 per 100 people, so far.

After criticism of his virus strategy intensified, Bolsonaro’s first move on Monday was to sacrifice his foreign minister Ernesto Araújo. A close ideological ally, fond of railing against the “narcosocialism” of previous Brazilian governments and in favour of traditional Christian values, Araújo was replaced with a lower-key, more discreet diplomat, Carlos Alberto Franco França.

“Araújo was the pre-eminent exponent of the anti-globalisation, conservative ideology in the government,” said Elena Lazarou, associate fellow at Chatham House. “But increasingly since the election of Joe Biden, that made no sense and was problematic for Brazil’s foreign relations with the US and with China, as well as for global [vaccine] supply chains.”

Deepening the government crisis, the head of the army, General Edson Leal Pujol, and the heads of the navy and air force stepped down on Tuesday after media reports said they had disagreed with Bolsonaro over health policy and the role of the armed forces.

Pujol had angered the president by stressing how successful the military had been in containing coronavirus within its ranks by insisting on strict health measures — a sharp contrast to Bolsonaro’s own opposition to lockdowns.

A day earlier, Bolsonaro had unexpectedly fired defence minister General Fernando Azevedo e Silva. Previously seen as an ally, the minister departed abruptly amid reports of growing tensions with the president and was replaced by another general, Walter Braga Netto, who had served as Bolsonaro’s chief of staff.

“Bolsonaro is feeling cornered and he wants people around him who are 100 per cent loyal,” said Oliver Stuenkel, associate professor of international relations at the Getúlio Vargas Foundation in São Paulo. “The names [of the replacements] are close to the president — these are all people who will stay with the president until the end.”

Azevedo pointedly wrote in his resignation letter that he had “preserved the armed forces as institutions of the state”, underlining his differences with Bolsonaro. The president, a former army captain who has praised Brazil’s 1964-85 military dictatorship, last year spoke at a demonstration where participants called for a state of emergency and the shutdown of the supreme court.

Bolsonaro has stacked his government with serving and retired military officers, from his vice-president, General Hamilton Mourão, down. His conservative positions on everything from violent crime to homosexuality have gone down well with the active-duty rank and file, but the generals are concerned about the risks of being tarnished by association with an increasingly unpopular government.

“Bolsonaro wanted to make the army into almost a kind of praetorian guard,” said Vinicius de Carvalho, an expert on Brazil’s military at King’s College London. “But the army didn’t want that. They are already very concerned about the damage to their image.”

As he left the government, Azevedo privately assured the head of the supreme court, Luiz Fux, of the military’s continued commitment to respecting democratic institutions, a court source said.

Bolsonaro’s other aim with the reshuffle, analysts said, was to shore up his political support in Congress with an eye on his bid for re-election next year. The key post of secretary of government, which co-ordinates relations between the presidency and the legislature, went to a politician from the “Centrão” bloc, which has backed Bolsonaro in recent months.

Given Bolsonaro’s mercurial temperament and his open disdain for democratic institutions, some analysts are worried about the risks of a Capitol Hill-style showdown after the election in October 2022.

The FGV’s Stuenkel said that if Bolsonaro, a big admirer of Donald Trump, were to lose the election, it was possible that he might try to block a transition of power with the help of the army.

“That’s what I'm most concerned about,” he said. “He’s setting the stage for potential trouble during and after the presidential election next year.”