A Cairo court has ordered the release of the brother of al-Qaida's top leader after he spent over two years in prison without trial over accusations of leading a terrorist group, an Egyptian lawyer said Tuesday.

Attorney Khaled al-Masri told The Associated Pres that Mohammed Al-Zawahri is to be placed under house arrest. Al-Zawahri is the brother of Egyptian-born al-Qaida leader Ayman al-Zawahri, who succeeded Osama bin Laden as the chief of the global terror network.

Mohammed al-Zawahri was arrested in August 2013, days after security forces stormed a sit-in in Cairo by supporters of ousted Islamist President Mohammed Morsi, killing hundreds. He led a jihadi Salafi group and was a close ally of Morsi.

Although he was subsequently acquitted in one terrorism-related case, he remained in detention for a second case in which he was never formally charged but was accused of forming a terrorist organization.

In a separate development, authorities at Cairo's international airport banned investigative journalist and human rights advocate Hossam Bahgat from leaving the country Tuesday. The measure was ordered by the public prosecutor, Bahgat said on his official Facebook page, but added that he was not given more details.

The Egyptian military had detained Bahgat for two days in November under accusations of spreading "false news."

At the time, he had said he was questioned about an article he wrote the previous month in which described the August 2015 conviction of a group of military officers on charges of conspiring with the banned Muslim Brotherhood to plot a coup against President Abdel-Fattah el-Sissi.

His detention stirred a wave of condemnation, including by U.N. chief Ban Ki-moon.

In 2002, years before becoming a journalist, Bahgat founded the Egyptian Initiative for Personal Rights, which became one of the country's most prominent rights groups.