The heads of all three branches of Brazil’s armed forces have resigned in another blow to President Jair Bolsonaro’s leadership.

The shock departure of the country’s three top military commanders comes after the president carried out a cabinet reshuffle which included the replacement of defence minister Fernando Azevedo e Silva, who said in his resignation letter he had “preserved the armed forces as state institutions”, seen as a nod to his efforts to keep generals out of politics.

He is said to have told confidants that he felt uncomfortable in government and that he was facing pressure from the president for the armed forces to show him greater loyalty, sources told Reuters news agency.

The three military chiefs announced they were stepping down after they met with the new defence minister, General Walter Souza Braga Netto, on Tuesday.

Their exits underline the scale of the political, public health and socioeconomic problems Mr Bolsonaro’s crisis-stricken administration is battling.

Mr Bolsonaro, a far-right former army captain who has often praised Brazil’s former period of military dictatorship, has appointed current and former soldiers to key posts since taking office in January 2019.

“Since 1985, we haven’t had news of such clear intervention of the president with regard to the armed forces,” said Carlos Melo, a political science professor at Insper University in Sao Paulo.

More from Brazil

Mr Melo said the military itself had so far refrained from politics, but added: “Will this resistance continue? That’s the question.”

The president has been criticised over his handling of the coronavirus pandemic, including a sluggish vaccine rollout.

He spent months downplaying the severity of the COVID-19 outbreak, which he dismissed as “a little flu”.

More than 317,000 COVID deaths and 12.6 million cases have been recorded in Brazil.