Egypt's high administrative court on Tuesday ruled that previous judicial decisions in favor of transferring the two Red Sea islands of Tiran and Sanafir to Saudi Arabia were invalid, AFP reported.
The accord was first announced in April of 2016, triggering protests by the Egyptian public who believe the islands are Egyptian.
One court rejected the agreement in January, but Egypt’s Court of Urgent Matters voided that ruling in April.
Last week, Egypt's parliament approved the agreement, a day after an Egyptian parliamentary committee had done so.
The government says the two islands belong to Saudi Arabia but had been leased to Egypt in the 1950s.
The administrative court, however, ruled that all judicial decisions taken to date by the urgent matters court would be considered invalid.
"The ruling (on Tuesday) signifies that the land is Egyptian," said Khaled Ali, a lawyer who argued in the administrative court that the islands belonged to Egypt, according to AFP.
The verdict would affirm that any attempt to transfer the islands would be considered unconstitutional "even if the president ratified the agreement", Ali said.
Opponents of the deal say the government is willing to hand over the islands in exchange for funds from oil-rich Saudi Arabia.
The two islands provide Israel's only access to the port of Aqaba, though reports have suggested that Egypt informed Israel in advance of its intention to transfer the sovereignty over the two islands.