The Shubra court judge denied on Monday an appeal put forth by rights lawyer Malek Adly's defence team against his detention pending investigation.
Adly is accused of calling for the April 25 protests, opposing the maritime border demarcation agreement between Egypt and Saudi Arabia, which saw Egypt handing the two Red Sea islands of Tiran and Sanafir to Saudi Arabia.
He was arrested early May and taken to Shubra al-Kheima police station based on a decision by the public prosecution.
Adly has since been detained on charges of inciting protest, publishing false news, possessing publications inciting against the state, joining an organisation that aims to disable the provisions of the constitution, and working to overthrow the regime.
Sameh Samir, Adly's defence lawyer, told Aswat Masriya that the defence team demanded Adly's release because there is no justification for his detention.
Adly is known for being openly critical of the government. He was among those who criticised the Egyptian-Saudi agreement on Facebook and asked Egyptians to authorise him to file a lawsuit with the administrative court to cancel the decision to cede the two islands.
As news of his arrest went viral, renowned public figures and local rights groups called for Adly's immediate release.
In June, the Administrative Court annulled the agreement, affirming that the islands fall within Egypt’s borders.
The State Lawsuit Authority, which represents the government, appealed against the ruling before the Supreme Administrative Court .
The court however adjourned the case pending a request filed to recuse the judge.
The agreement has stirred controversy since it was signed in April, with critics accusing President Abdel Fattah al-Sisi of "selling Egypt" to Saudi Arabia in return for aid.
Thousands of Egyptians took to the streets later in April in rare protests against the agreement, amid a police campaign of mass arrests of activists that opposed the islands handover.