An Egyptian court on Saturday sentenced ousted president Mohamed Mursi to life in prison in an espionage trial in which six of his co-defendants were handed death penalties.

Mursi, who has been sentenced to death in a separate trial, was Egypt's first democratically elected president but the army overthrew him in 2013 and cracked down on his supporters.

He was given life in prison Saturday for leading an unlawful organisation and 15 years for having "stolen secret documents concerning state security," his lawyer said.

But Morsi was acquitted of having supplied classified documents to Qatar, Abdel Moneim Abdel Maksoud told AFP.

The six defendants sentenced to death for helping to pass secret documents to Qatar include three journalists, two from Qatar-based TV channel Al-Jazeera, tried in absentia.

The media network denounced the verdict as an attack of free press.

Al-Jazeera "denounces, condemns, and entirely rejects the verdict," a statement said.

The verdict is "unjust and politicised" and "part of the ruthless campaign against freedom of speech and expression, in order to muzzle the voice of free press."

Qatar's government also rejected the verdict, saying it was "unfounded, goes against truth and contains misleading claims" that are contrary to Doha's policies.

"The charge of espionage for Qatar against a former president and media men is surprising and unacceptable," added Ahmed Al Rumaihi, director of information at the foreign ministry.

Mursi came to power after the 2011 revolution that toppled longtime strongman Hosni Mubarak.

But after about one year in office, he was overthrown and detained by then-army chief Abdel Fattah al-Sisi, who is now Egypt's president.

Two of the journalists sentenced to death, Ibrahim Mohamed Hilal and Jordanian citizen Alaa Omar Mohamed Sablan, worked for Al-Jazeera.

The third has been named as Asmaa Mohamed al-Khatib, a female reporter with news outlet Rassd.

The three others handed the death penalty, who were present during the trial, are documentary producer Ahmed Ali Abdo, EgyptAir cabin crew member Mohamed Adel Kilani and university teaching assistant Ahmed Ismail Thabet, said the prosecution.

The death sentences were sent to the mufti -- Egypt's official interpreter of Islamic law -- as his opinion is legally required on death sentences although it is not binding.

Rights group Amnesty International criticised the trial outcome as "appalling" and called for the death sentences to be overturned and for the "ludicrous charges" against the journalists to be dropped.