CAIRO (AP) -- An Egyptian court on Tuesday rejected a border agreement that would have transferred two Red Sea islands to Saudi Arabia, and which had sparked street protests in Cairo.
The ruling was a rare rebuke of the government's foreign policy by the judiciary, which has been largely supportive of President Abdel-Fattah el-Sissi, and could strain ties with Riyadh, which has provided billions of dollars in aid to Egypt in recent years.
El-Sissi's government, together with loyal media, has zealously defended the April agreement, arguing that it would bring economic benefits to Egypt. It says the islands have always been part of Saudi Arabia, and were only placed under Egyptian control in 1950 for protection from Israel. The government said it would study the ruling's citation before it decides to appeal, a virtual certainty.
The verdict was issued by a court that rules on cases challenging executive decisions. The government has 10 days in which to apply for an injunction against the ruling and 60 days to appeal it.
Critics of the border agreement, which was announced during a high-profile visit by King Salman alongside billions of dollars' worth of new Saudi aid, view it as a sell-off of sovereign territory. Thousands of protesters took to the streets over the transfer of the islands, in the largest demonstrations since El-Sissi was elected in 2014.
Authorities responded with a wave of arrests of protesters and activists. However, most were later acquitted, released on bail or fined after brief trials.
Opponents of the deal have also claimed that surrendering the two islands is unconstitutional and have demanded a nationwide referendum on the issue. The government has rejected those demands.
There was no immediate comment from the Saudi government on the court ruling.
Egypt's parliament, which is packed with government supporters, has been expected to debate the agreement and vote on whether to endorse it. No date has been set for the discussion.
In a brief verdict met with an eruption of applause and joyful chants, judge Yahya Dakroury ruled that the two islands at the mouth of the Gulf of Aqaba remain under Egyptian sovereignty and banned "any changes on the two islands for the benefit of any foreign country."
"This is a very important step," said Khalid Ali, a prominent rights lawyer and former presidential candidate who jointly brought the case against the government with another lawyer. "I appeal to the Egyptian government ... to implement the court's ruling. This is the land of our ancestors; you must protect it, and those islands are Egyptian and will remain Egyptian forever."
Ali spoke as about two dozen supporters outside the court chanted "bread, freedom, those islands are Egyptian," a play on the most popular slogan of Egypt's 2011 uprising - "bread, freedom and social justice" - that toppled autocrat Hosni Mubarak.
The uninhabited islands of Tiran and Sanafir lie along narrow shipping lanes leading north to the port cities of Eilat and Aqaba in Israel and Jordan, respectively. The closure of the strait by then Egyptian President Gamal Abdel Nasser is seen as one of the main causes of the June 1967 Arab-Israeli war, in which Egypt lost the Sinai Peninsula. It was returned to Egypt, together with the two islands, under the landmark 1979 peace treaty with Israel. Under the treaty's provisions, Egypt is not allowed to station troops on either island.
Billions of dollars of aid from Saudi Arabia, Kuwait and the United Arab Emirates have kept Egypt's ailing economy afloat in the nearly three years since el-Sissi, as defense minister, led the military's ouster of the Islamist Mohammed Morsi, Egypt's first freely elected president.
El-Sissi has acknowledged that the demarcation negotiations were held over several months in secrecy to avoid unwanted media attention and opposition to the deal.
"We did not surrender our rights, but we restored the rights of others," el-Sissi said in April. "Please, I don't want anyone to talk about this anymore."
By AP