A Cairo high court has upheld a previous ruling to stop the planned transfer of two Egyptian-controlled islands in the Red Sea back to Saudi Arabia.

Cheers erupted in the High Administrative Court as a government appeal against a lower court’s decision was upheld on Monday.

Egyptian President Abdul Fattah al-Sisi decided to transfer tiny uninhabited Tiran and Sanafir in the Gulf of Aqaba, which ships must pass on their way to Jordan and Israel, in April last year.

The fate of the two islands has been at the heart of recent friction between Riyadh and Cairo over a string of regional issues, including the conflicts in Syria and Yemen.

Egyptian troops have been stationed on the islands since the 1950s, when Saudi Arabia asked Egypt to protect them during possible skirmishes with Israel.

The decision to hand them back was met with widespread anger and protests across Egypt in which hundreds of people were arrested.

Many said they saw the islands as part of their country, pointing out school textbooks and the country’s constitution said as much.

President Sisi was accused of “selling” the islands in return for a multi-billion dollar aid and financial bailout package from Saudi Arabia, announced shortly before the transfer.

File aerial picture showing the Red Sea's Tiran (foreground) and Sanafir (background) islands in the Strait of Tiran between Egypt's Sinai Peninsula and Saudi Arabia (AFP/Getty Images)

The Gulf kingdom has been a strong backer of Mr Sisi’s government since he led the military coup that overthrew democratically elected Muslim Brotherhood President Mohammed Morsi in 2013.

Last June human rights activists took the government to a lower court over the proposal, which ruled that changes to Egypt’s maritime borders could not be amended in favour of another state.

The high court’s decision dismissed the government’s appeal to transfer the islands on the grounds that it did not provide sufficient evidence that they had originally belonged to Saudi Arabia.

A 1906 maritime treaty between Egypt and the Ottoman Empire was “irrefutable evidence” that Egypt has sovereignty over the islands, the court found, as the kingdom of Saudi Arabia was not established until 1932.