The plan to cede the islands to Riyadh, an ally which has given billions of dollars in aid to Egypt, was announced in 2016 and was bitterly opposed by Egyptians who launched political and legal campaigns to stop the deal.
The Supreme Court ruled that no other court had jurisdiction over the matter, blocking two opposing verdicts - one by the Supreme Administrative Court, which was against ceding control of the islands of Tiran and Sanafir, the other by the Court of Urgent Matters, which looked to void that decision.
"The signature of the representative of the Egyptian state on the maritime borders agreement between the governments of Egypt and Saudi Arabia is undoubtedly an act of sovereignty," the Supreme Court said in a statement, adding that approving the deal was down to Egypt's legislative body.
Prince Mohammed signed the deal on behalf of Saudi Arabia before becoming crown prince.
Egypt's parliament backed the deal in June, and President Abdel Fattah el-Sisi ratified it one week later.
Opponents say Egypt's sovereignty over the islands dates back to 1906, before the Saudi regime was founded.
Saudi and Egyptian officials say the islands belong to the kingdom and were only under Egyptian control because Riyadh had asked Cairo in 1950 to protect them.
Saudi Arabia has supported Sisi since he toppled the country's first democratically elected president Mohamed Mursi of the Muslim Brotherhood in 2013, and legal wrangling over the Red Sea deal was a source of tension between the two countries.
Opposition to the deal has been a problem for Sisi, sparking the only major street protests since he came to power in 2014 and becoming a rallying point for opposition figures that have been marginalized during his rule.
.The issue had sparked rare protests in Egypt, with President Abdel Fattah el-Sisi accused of having bartered Tiran and Sanafir for Saudi largesse