An Egyptian court on Saturday upheld the life sentence against ousted Islamist president Mohamed Morsi in what is known as the Qatar espionage case.

The Court of Cassation, Egypt’s highest appeal court, rejected the former president’s appeal and said the ruling is “final and unappealable,” state-run MENA news agency reported.

The court also confirmed death sentences of three prominent members of the Muslim Brotherhood in the same case.

Life sentence in Egypt is 25 years in prison.

Morsi received the original sentence in June 2016 after being found guilty of using his post to leak classified documents to Qatar and selling them to al-Jazeera channel.

The documents allegedly include information on general and military intelligence, armed forces and state policy secrets which harm the national security.

In October last year, the same court had confirmed a 20-year prison sentence against Morsi for taking part inciting violence near Ittihadeya presidential palace in 2012.

In November, the court had quashed one of the two life sentences handed down to Morsi and ordered a retrial in connection with the Qatar espionage case.

Morsi, who became Egypt’s president in June 2012 after the first democratic elections in the country, was ousted in a military coup after a year in power following mass protests against his rule.

He came to power after Egypt’s long-time president Hosni Mubarak was toppled in an uprising in 2011.

In May, 2015, Morsi and 106 Muslim Brotherhood supporters received death penalties over a mass jail break following the 2011 uprising. But his death sentence verdict was overturned.

In a separate case, the court condemned to death seven people for membership of a militant group affiliated to the Islamic State group in Libya.

The case’s documents were referred to the Grand Mufti, who must review all death sentences as per the Egyptian law.

His decision, however, is not binding.

The final decision of the court will be announced on November 25 which involves 20 defendants. However, the verdict can be appealed.

Charges also include possessing weapons, inciting violence and participating in the slaughtering of 21 Egyptian Coptic Christian workers in Libya in 2015.

The Egyptian government has been cracking down on the Muslim Brotherhood and its supporters since the ouster of Morsi, which left thousands in jail, and hundreds facing trials on a variety of charges.