Cairo prosecutors have ordered the release without charge of 25 people who were arrested on Friday while demonstrating against a government decision to hand over the Red Sea islands of Tiran and Sanafir to Saudi Arabia.
The detainees faced charges including "protesting without a licence" -- an offence pubishable by jail under a controversial law that bans all but police-sanctioned demonstrations.
They were allowed to walk free on Saturday evening following investigations, a judicial source said. A security source earlier said 26 people had been arrested at the Cairo rally on Friday, one of whom was released before appearing before the prosecution.
Several thousand people demonstrated in downtown Cairo on Friday in one of the biggest protests in recent years, which was dispersed after several hours by police who fired teargas.
There were also protests on Friday in other Egyptian cities, including Alexandria, as well as several arrests. Many of those arrested have subsequently been released.
During a visit by Saudi's King Salman last week, the Egyptian government announced it was handing over the two islands in the Gulf of Aqaba to Saudi Arabia.
The announcement has sparked widespread public outcry, with critics accusing President Abdel-Fattah El-Sisi of "selling" the islands.
Egyptian and Saudi officials say the islands belong to the Gulf kingdom and were only under Egyptian control because Riyadh had asked Cairo in 1950 to protect them.