![](https://amayei.nyc3.digitaloceanspaces.com/2018/09/haniya_morsy.jpg)
The ouster by the army of Islamist president Mohamed Morsy has crushed the dreams of Gaza's Hamas rulers, who will now have to build ties with the new Egyptian authorities, analysts say.
Hamas, which is affiliated to the Islamist Muslim Brotherhood from which Morsy hails, has lost a valuable ally in the deposed Egyptian president after feting his election to office in June 2012, they say.
"What happened in Egypt is a nightmare for Hamas which it did not expect," said Mukhaimer Abu Saada, political science professor at Al-Azhar university in Gaza.
On Wednesday the Egyptian army ousted Morsy, after just one year in office, following days of popular protests against him in Cairo and other cities.
"Over the past year Hamas had established a good relation with Morsy and the Muslim Brotherhood" in Egypt, said Saada.
Hamas chief Khaled Meshaal and Gaza's premier Ismail Haniya have both had a series of meetings with Morsy over the past year, establishing "official cooperation" between the two governments, he said.
"The new Egyptian government will not have good relations with Hamas which can no longer rely" on its support when it comes to Gaza, he said.
Saada noted that Hamas had been the target of a ferocious campaign in the Egyptian media, which accused it of meddling in Egypt's internal affairs before and after the 2011 uprising that ousted Hosni Mubarak.
On June 23, an Egyptian court ruled that Hamas and Lebanon's Hezbollah movement had with the Muslim Brotherhood been involved in facilitating the escape of prisoners, including Morsy, from a jail during the anti-Mubarak uprising.
Soon after Morsy was detained by Egypt's army after it announced his overthrow on Wednesday following days of mass streets protests, a military official said he may be charged over the jailbreak.
"What happened in Egypt is a blow to the Muslim Brotherhood, especially in the Gaza Strip," said Palestinian political analyst Hani Habib.
"The security situation in Sinai serves as justification (by Egypt) to put pressure on Hamas," he said.
"Egyptian security measures could affect Hamas through imposing restrictions on movement of its members."
On Friday, Egyptian authorities closed the Rafah crossing to Gaza following attacks in the Sinai peninsula in the wake of Morsy's dismissal.