An Egyptian court confirmed a 20-year prison sentence against former president Mohammed Morsi on Saturday.
The Court of Cassation also upheld sentences against eight of his codefendants, including seven who received the same prison term and one who was sentenced to 10 years in prison, a judicial official said.
Another court on June 2016 had sentenced Morsi to life on charges of "leading a terrorist group", in reference to the Muslim Brotherhood, which was blacklisted by the Egyptian authorities in late 2013.
The court, however, cleared Morsi of charges of spying for Qatar, which was a main backer of Morsi's administration while he was in power.
Egypt's first democratically elected leader, Morsi was ousted by the military in a 2013 military coup following protests against his presidency.
Amnesty International had denounced the initial trial against Morsi and the Muslim Brotherhood as a "travesty of justice".
Morsi was toppled by then army chief and now President Abdel Fattah al-Sisi following mass street protests.
Morsi's Muslim Brotherhood has been blacklisted and targeted in a crackdown that has killed hundreds of his supporters and jailed thousands.
Morsi and his co-defendants, along with a number of independent observers, say the charges are politically driven.
Since Morsi's ouster and imprisonment, the Egyptian authorities have launched a harsh crackdown on his Muslim Brotherhood group-killing hundreds and jailing tens of thousands-while relations between Cairo and Doha have nosedived.