Judge Ahmed Youssef dropped murder charges and said the sentence was linked to the "show of force" and unlawful detention associated with the case.

In addition to Morsi, 12 Brotherhood leaders and Islamist supporters, including Mohammed el-Beltagy and Essam el-Erian, also were sentenced to 20 years in prison.

Morsi and the rest of the defendants raised the four-finger sign symbolizing the sit-in at the Rabaah al-Adawiya mosque, where hundreds were killed when security forces violently dispersed the sprawling sit-in by Morsi's supporters on Aug. 14, 2013.

Morsi faces several other trials along with thousands of Muslim Brotherhood members following the military overthrowing him in 2013.

Morsi was ousted following demonstrations by millions of people calling on him to leave office.

Morsi is now held at a high security prison near the Mediterranean city of Alexandria. His incarceration there followed four months of detention at an undisclosed location.

In past sessions, Morsi and most of the defendants turned their backs to the court when Youssef played several video recordings of the clashes outside the palace in 2012.