GAZA CITY, July 6, 2013 (AFP) -- The ouster by the army of Islamist president Mohamed Morsi 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 Morsi 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 Morsi, 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 Morsi 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 Morsi 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 Morsi, from a jail during the anti-Mubarak uprising.
Soon after Morsi 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 Morsi's dismissal.
Haniya on Friday tried to strike an upbeat note despite the setback to Islamists in the region.
"Do not fear for the Palestinian cause or for the resistance (against Israel) or for Gaza. Egypt is behind us, as are the Arab and Islamic countries," Haniya said in a Friday sermon.
"We believe good will emerge from this Arab Spring, these revolutions and this rebirth. We expect the Arab Spring cycle to continue until its objectives are attained, including our own cause."
In its favour, Hamas, aware that it could become a "pawn" in the internal political battle in Egypt, had established contacts with the opposition there, Mussa Abu Marzuk, a leader from the movement in Cairo told AFP in April.
Analysts predict that Hamas will manage to find a modus vivendi with the new authorities in Egypt, as it did during the Mubarak era.
"Hamas is not obliged to be with the Muslim Brotherhood, after all it has long been on the side of the Syrian regime," said political science professor Saada. The Muslim Brotherhood is one of the forces ranged against Assad's regime.
"Relations will not be as bad as during Mubarak's rule whatever the new situation in Egypt will be," said Mustafa Sawaf, political analyst and former editor of a newspaper close to Hamas.
"The Palestinian file and the Gaza Strip is a security issue dependent on the Egyptian intelligence services which have not changed since the Mubarak era."