Malawi has confirmed the death of President Bingu wa Mutharika, leaving the vice-president, Joyce Banda, to become southern Africa's first female head of state.

The government declared a period of official mourning after delaying reports of Mutharika's death for two days. Officials said the president, 78, died from a heart attack and his body had been flown to a military hospital in South Africa.

Fears of a succession struggle receded as state institutions backed the constitutional handover to Banda.

The delay in the announcement had raised worries about a political crisis because Banda had been expelled from Mutharika's ruling DPP party in 2010 after an argument about the succession, though she retained her state position.

Banda, 61, appeared at a news conference in the capital Lilongwe and ordered national flags to be flown at half-mast and the state broadcaster to play sombre music.

"I call upon all Malawians to remain calm and to keep the peace during this time of bereavement," Banda said, flanked by members of the cabinet, the attorney general and the heads of the army and the police.

Asked whether she was assuming the presidency, Banda, a women's rights activist, replied: "As you can see, the constitution prevails."

The constitution stipulates that the vice-president takes over if the president dies, but Mutharika, who ruled for eight years, appeared to have been grooming his brother Peter, the foreign minister, as his de facto successor.

Banda is expected to run the country until scheduled elections take place in 2014.

The presidency and cabinet issued a statement assuring citizens and the international community "that the constitution of the Republic of Malawi will be strictly adhered to in managing the transition".

Both Britain and the US called for a smooth transition of power. The foreign secretary, William Hague, said on Saturday: "I urge all sides to remain calm and [hope] that a peaceful handover takes place as provided for under Malawi's constitution."

The US state department said in a statement: "We trust that the vice-president (Banda) who is next in line will be sworn-in shortly."

Medical sources said Mutharika's body was flown to South Africa because Malawi's energy crisis was so severe the Lilongwe state hospital would have been unable to conduct a proper autopsy or even keep his body refrigerated.