Egypt's Supreme Administrative Court has upheld a ban issued by a lower court on the handover of two strategic Red Sea islands to Saudi Arabia, in a blow to the administration of President Abdel-Fattah al-Sissi.
Opposition lawyers chanted "Long live Egypt" and sung the national anthem after the court handed down its verdict.
Al-Sissi had come under harsh criticism from opponents over a border agreement concluded in April which would have seen the islands of Tiran and Sanafir come under Riyadh's control. The issue saw rare non-Islamist protests which were repressed with hundreds of arrests.
Egypt's relations with Saudi Arabia, which gave the country major financial support after al-Sisi ousted Islamist president Mohammed Morsi in 2013, have declined in recent months amid apparent differences over the conflicts in Syria and Yemen.