An Egyptian court has blocked the cancellation of an Egyptian-Saudi pact under which Cairo will transfer control of two Red Sea islands to Riyadh.

Thursday's ruling came in response to a June verdict by another court that annulled the agreement reached during a visit to Egypt in April by Saudi Arabia's monarch, King Salman.

The agreement unleashed the largest street protests in Egypt since President Abdel-Fattah el-Sissi came to office in 2014. Authorities then arrested hundreds of protesters but later released most of them.

The June ruling was appealed by the government, but no date has been set for the first hearing.

Tiran and Sanafir lie at the mouth of the Gulf of Aqaba, overlooking narrow shipping lanes to the ports of Eilat and Aqaba, in Israel and Jordan respectively.