document: Egypt's President Abdul Fattah al-Sisi announced that Tiran and Sanafir would be transferred in April, during a visit by Saudi Arabia's King Salman.
  More than 150 people were jailed in connection with protests over the deal, though many were later acquitted or had their sentences reduced on appeal.
  The Egyptian government has said it will challenge Tuesday's ruling.
  Tiran and Sanafir are uninhabited and located at the mouth of the Gulf of Aqaba, a strategic part of the Red Sea bordered by Israel, Jordan, Egypt and Saudi Arabia.
  Egyptian troops have been stationed there since 1950 at Riyadh's request.
  Mr Sisi's decision in April to cede control of them to Saudi Arabia sparked widespread criticism.
  The president was accused of violating the constitution and "selling" the islands in return for a multi-billion dollar aid package unveiled by King Salman during his visit.
  But Mr Sisi insisted that Tiran and Sanafir had always belonged to Saudi Arabia.
  On Tuesday, Egypt's State Council, an administrative court, issued a verdict annulling April's maritime borders agreement between Cairo and Riyadh.
  The maritime border agreement signed earlier this year between Egypt and Saudi Arabia took many Egyptians by surprise.
  Since then, protesters have taken to the streets calling the arrangement unconstitutional, and accusing the government of giving away Egyptian territories in return for aid packages and investments worth billions of dollars from Saudi Arabia, a strong backer of President Sisi.
  Some of these protesters were arrested and charged with disrupting public order. A few are still behind bars.
  The lawsuit was filed by a number of prominent human rights lawyers, headed by a former presidential candidate, Khaled Ali.
  When the verdict was issued, many cheered inside the courtroom, chanting "the islands are Egyptian". But the legal battle has not come to an end yet, because the decision can be appealed.
  The verdict stated that the two islands would "remain under Egyptian sovereignty".
  If it is approved by the country's High Administrative Court it will become legally binding.
  However, the State Lawsuits Authority, which represents the Egyptian state in lawsuits, said on Tuesday evening that it would challenge the ruling, state television reported.
  Mr Sisi has cracked down on all dissent since leading the military's overthrow of President Mohammed Morsi in 2013.
  Since then, more than 1,000 people have been killed and 40,000 are believed to have been jailed, most of them supporters of Mr Morsi's Muslim Brotherhood.
summary: An Egyptian judge has quashed a government decision to hand control of two Red Sea islands to Saudi Arabia.