Mohamed Morsy, the controversial former Egyptian President, is back in prison.
Morsy, who was ousted by military leader Abdel Fattah el-Sisi, was convicted on Tuesday and sentenced to 20 years in prison. He faced charges of inciting violence and facilitating the killing and torturing of protesters outside the presidential palace in December 2012.
Morsy has indicated he will appeal the verdict, according to his counsel.
The controversial leader had become Egypt's first democratically elected President in June 2012, before being deposed by a military coup led by el-Sisi in July 2013. There were widespread allegations of voting irregularities in the election.
Morsy was controversial as upon winning the vote he proceeded to enact Islamist policies which were inconsistent with his election platform. The radical changes were poorly received in Egypt, which has a record of embracing western culture and progressive social policies.
"This is a sad and terrible day in Egyptian history," Morsy's Freedom and Justice Party said in a statement Tuesday. "Coup leaders have sentenced Mohamed Morsi to decades in prison for nothing more than championing the democratic will of the people."
For Morsy to end up in court careful procedures were needed in order to adhere to the constitution. His ouster and subsequent trial required the approval of two-thirds of the parliament and a special court composed of the country's top judges.
Morsy was combative and at various points in the trial asserted that he was the President of Egypt and refused to recognize the court as legal.
His behaviour was so distruptive that it became necessary to enclose the defendants cage in soundproof glass. Morsy then withdrew his defense team from the case.
The worst is not yet over for Morsy. He is on trial in three other cases, including two on charges of espionage. His third trial is to answer allegations he and 18 other members of the banned Muslim Brotherhood broke out of the Wadi-Natroun prison, Egyptian state media reported.
Morsy is accused of collaborating with the Palestinian Islamist group Hamas and the Lebanese Shia group Hezbollah to escape.