An Egyptian court has confirmed a death sentence handed to ousted Islamist President Mohammed Morsi over a mass prison break during the 2011 uprising that eventually brought him to power.

Judge Shaaban al-Shami confirmed the ruling Tuesday after consulting with the country's religious authority as required by Egyptian law in cases involving the death penalty. The religious authority issues non-binding opinions on such sentences.

The ruling will automatically be appealed. The judge also confirmed death sentences for five other jailed leading members of Morsi's Muslim Brotherhood group.

The military overthrew and detained Morsi, Egypt's first freely elected president, in July 2013 amid massive protests demanding his resignation.