An Egyptian court has overturned the death sentence against the country’s deposed former president Mohamed Morsi, ordering a retrial.

Egypt’s Court of Cassation ruling on Tuesday reverses a lower court’s June 2015 decision to sentence him to death for his alleged role in jail breaks during the country’s 2011 uprising, which deposed long-standing president Hosni Mubarak.

Morsi – Egypt's first democratically elected president – was overthrown in a military coup in July 2013, just one year into his four-year term after protests against his rule.

Morsi's Muslim Brotherhood party – a pan-Arab Islamist movement previously headquartered in Egypt – has since been outlawed, and tens of thousands of supporters arrested and imprisoned.

The court ruled that five of his co-defendants, including the Brotherhood’s supreme guide Mohamed Badie, will also be retried, and 21 more life sentences handed down to Muslim Brotherhood members have been struck down.

In October an appeals court upheld Morsi’s 20-year sentence following a conviction for ordering the unlawful detention and torture of opposition protesters during clashes with Brotherhood supporters outside a presidential palace in Cairo in December 2012.

Morsi has also been sentenced to life in prison for allegedly conspiring to commit terrorist acts with foreign organisations and to another 40 years for allegedly leaking state secrets and sensitive documents to Qatar.

The Court of Cassation is to issue a verdict next week on his appeal against a life sentence on charges of spying for Iran, Hezbollah and Hamas.