An Egyptian court has sentenced former president Mohamed Morsi to life in prison on charges of spying for Palestinian group Hamas, Lebanese group Hezbollah, and Iran.

The court still has to decide whether to confirm or commute death sentences it handed down against Morsi in a separate case related to a 2011 prison break.  

General guide of the Muslim Brotherhood Mohamed Badie was also sentenced to 25 years in jail on spying charges on Tuesday. The court handed town a total of 17 life sentences on charges of spying.

Muslim Brotherhood leader Khairat el-Shater and two others were sentenced to death in the same case.

Death sentences were also handed to 13 other defendants in absentia.

Morsi and 100 other defendants who received the death sentence were also expected to hear the final verdict on Tuesday in the case related to their escape from prison during the 2011 uprising that ousted former president Hosni Mubarak.

Yehia Ghanem, a former editor of Al Ahram newspaper, told Al Jazeera that it was impossible to guess what the outcome would be in the jailbreak case.

"Nobody can predict what is going to happen when we are talking about the unpredictable regime that is ruling Egypt," Ghanem said.

"The whole trial sits as an example of the outcome of trying to assume civil rule in the country. It is also a precedent for other presidents whether they are democratically elected or not."

 Morsi was sentenced to death on May 17 in the prison break-case, prompting immediate condemnations from rights groups and world leaders.

The court ruled that the sentencing of Morsi and other defendants would be referred to the grand mufti, the highest religious authority in Egypt, for confirmation before the final verdict.

The army ousted Morsi, Egypt's first democratically elected president, in July 2013 after mass protests calling for an end to his divisive one-year rule. 

Egyptian authorities have since banned Morsi's Muslim Brotherhood and arrested thousands of his supporters.

In April, a court sentenced Morsi and 12 other defendants to 20 years in prison for ordering the arrest and torture of protesters in clashes outside the presidential palace in December 2012.

Source: Al Jazeera and agencies