CAIRO (Reuters) - An Egyptian court ruled on Sunday that a judicial decision to block the transfer of two Red Sea islands to Saudi Arabia is void, judicial sources said, potentially reviving a deal that triggered protests in Egypt.

A court in January rejected a government plan to transfer the two uninhabited islands to Saudi Arabia after a maritime demarcation accord was announced in April. The accord awarded sovereignty of the islands to Saudi Arabia, even though most Egyptians believe they belong to Egypt.

The decision by Egypt’s Court of Urgent Matters is subject to appeal and any final deal must be approved by parliament.

The latest twist in this issue came as bilateral relations appear to be warming after months of tension.

Egyptian President Abdel Fattah al-Sisi accepted an invitation last week from Saudi Arabia’s King Salman to visit his country in April, a move that came on the heels of the kingdom’s decision to restore oil aid shipments to Egypt after a halt of about six months.

The ongoing island litigation had previously been a source of unease between Egypt and Saudi Arabia, which has showered Cairo with tens of billions of dollars in aid in recent years.

Human rights lawyer Khaled Ali, whose case in an administrative court had nullified the agreement, said the ruling was beyond the jurisdiction of the Court of Urgent Matters. He described it as a way for parliament to take judicial cover while debating an accord already rejected by other courts.

“The high administrative court rulings are final, and their implementation may not be stopped or nullified except by another ruling of the high administrative court,” he wrote in a post on his Facebook page.

Saudi and Egyptian officials had argued that the islands belonged to Saudi Arabia and were only under Egyptian control because Riyadh asked Cairo in 1950 to protect them.

But lawyers who had opposed the accord said Egypt’s sovereignty over the islands dated back to a treaty in 1906, before Saudi Arabia was founded.