An Egyptian court upheld Saturday the decision to release lawyer and activist Malek Adly, turning down a prosecution appeal on Adly's release.
On Thursday, another court ordered the release from detention of human rights lawyer Adly pending investigations on a number of charges, including inciting protests.
The prosecution appealed the decision.
The well-known lawyer, who was arrested 6 May, is accused of inciting violations of the protest law by calling for demonstrations against the 8 April Egyptian-Saudi border demarcation agreement concerning the Red Sea islands of Tiran and Sanafir.
Adly is also accused of undermining security, trying to destabilise the country and planning to overthrow the regime. He has denied all charges.
Last month, the Egyptian Lawyers Syndicate filed an official demand calling on authorities to allow the detained lawyer out of solitary confinement where he has been held since his arrest in May.
According to Adly's wife, Asmaa Ali, his health has deteriorated rapidly because of the conditions of his detention.
Protesting without a police permit is a crime in Egypt, and violators are often give jail terms and hefty fines.