An Egyptian court on Saturday sentenced ousted Islamist president Mohamed Morsi to 40 years in jail in the case publicly known as "Qatar espionage."
Morsi, along with two of his aides, was handed down a life sentence in jail for leading an unlawful organization.
In Egypt, a life sentence is 25 years in jail.
Morsi and his secretary, Amin el-Sirafy, received an additional 15-year sentence for leaking classified documents.
However, the court acquitted the Islamist leader for supplying Qatar with the classified documents directly or in person.
"Morsi as a president has appointed some prominent figures from the Muslim Brotherhood group in sensitive jobs in the presidency, and has handed them very serious reports about the Egyptian Armed forces, its bases and means of arming, in addition to internal and external policies of the country," the presiding judge said.
El-Sirafy, Morsi's secretary, has handed those documents to the Qatari intelligence and the Doha-based Al Jazeera channel, the judge added.
Commenting on the verdict, the Freedom and Justice Party, the political arm of the Muslim Brotherhood, said that Morsi got 40 years in prison over espionage on the anniversary of his assuming office.
In a statement on its website, the party named the trial as "the absurd case of spying."
Qatar was a main backer of Morsi and his group while he was in power between 2012 and July 2013.
Also on Saturday, the Cairo Criminal Court confirmed death sentences against six people linked to the outlawed Muslim Brotherhood for allegedly passing documents related to national security to Qatar and the Doha-based TV network during Morsi's rule.
All Saturday's verdicts can be appealed.
On May 17, the judge referred the case to the Mufti, the country's official interpreter of Islamic law who plays an advisory role, as required by Egyptian law to consider death sentences for the Morsi's six codefendants.
"The defendants leaked the confidential reports and documents about the centers, arms and data of the Armed Forces and sent them to a foreign county for money," the presiding judge read the mufti's final report.
"Spying crime requires murder, according to Islam jurists," added the report.
The six convicted defendants include two documentary and media producers with Qatari Al Jazeera channel.
Three of them were sentenced in absentia and will have the sentences squashed for an appeal if they ever hand themselves over and appear in court.
Morsi and the other 10 co-defendants had leaked "classified documents" to Qatar, according to the persecutor.
The documents allegedly contained secrets on "national security," and were allegedly traded with the Qatari intelligence for a million dollars. The prosecution also accused the defendants of working for the "terrorist branded Muslim Brotherhood" organization.
Morsi was convicted in three other cases to death, a life sentence and 20 years in prison.
On May 17, 2015, Morsi and 106 supporters of his Muslim Brotherhood received death penalties over a mass jail break following the 2011 uprising that ousted the long time ruler Hosni Mubarak.
The ousted Islamist president, along with Brotherhood guide Mohamed Badie and other seven members of the group, was sentenced to life in prison for conspiring with foreign militant groups Hamas and Hezbollah against Egypt's national security.
Another court sentenced him to 20 years in prison for clashes that erupted outside a presidential palace in December 2012 between his supporters and opponents, which killed up to 10 people.
Morsi was toppled by the army in 2013 in response to mass protests against his one-year rule. His Muslim Brotherhood group has been designated as a terrorist group.
Hundreds of members of the group received death and life sentences, mostly over violence, murder and spying charges.