The ouster of Egyptian President Mohammed Morsi has delivered a sharp jolt to Gaza's Hamas rulers, robbing them of their most important ally and raising difficult questions about the future of Islamic political movements in the region.

On Friday, Hamas Prime Minister Ismail Haniyeh said he is "monitoring developments" in Gaza's larger neighbor, and is hopeful relations will endure despite the crisis.

"We are not afraid of losing our cause, no fear that our cause will be absent from the Islamic nation's agenda, despite the difficulties and hard circumstances that sometimes the Islamic nation faces," Haniyeh said at Friday prayers.

Earlier in the day, Egypt shut its border crossing with the territory, citing security concerns after suspected Islamic militants attacked four sites in the northern Sinai Peninsula. One soldier was killed and three were wounded. Some 200 Palestinians were turned back to Gaza after the order.

Jittery Hamas officials in Gaza have been otherwise quiet as they tried to adjust to the new reality. But it appeared likely that after making important gains over the past year, their group will see its regional standing weakened, at least in the short term. The rival Palestinian movement Fatah, which lost control of Gaza to Hamas six years ago, welcomed the changes in Egypt.

"I am sure that Hamas is carefully considering every move and every word. This is a strike at the heart of the experience of the Muslim Brotherhood in power," said Atef Ahmad, a Gaza political analyst. "Hamas is now in a difficult situation."

Relations with Egypt are critical to Gaza. Gaza shares a border with Egypt and shares important cultural ties with its larger neighbor, which controlled the seaside strip before it was captured by Israel in the 1967 Mideast war. Israel and Hamas are bitter enemies, so Egypt is the primary gateway for Gazans to leave the territory. Egypt is also a key supplier of goods, ranging from fuel to building materials to cars and foods, much of it through an illicit system of smuggling tunnels along the border.

The streets of Gaza were quiet on Thursday, a vivid contrast to the wild celebrations that erupted just a year ago when Morsi won Egypt's first democratic election.

Shopkeepers were glued to TV and radio broadcasts from Egypt. Hamas' al-Aqsa TV station provided brief hourly updates about Egypt but otherwise ignored the situation, while Hamas supporters posted Quranic verses about patience and victory on Facebook and other social media pages.

"I think that Egypt's relations with Gaza will be tepid for a short while, but will return back to normal," said Mustafa Sawaf, a pro-Hamas commentator. "The public interest requires a strong relationship between Gaza and Egypt."

Morsi and Hamas both come from the pan-Arab Muslim Brotherhood movement, and his victory was seen as a ringing endorsement of the group's rigid Islamist ideology. Morsi quickly ushered in an era of new relations with Hamas after years of strained ties with his predecessor, the longtime Egyptian ruler Hosni Mubarak.

While Mubarak limited contact with Hamas to security matters along the border, Morsi gave Hamas rulers VIP treatment. Hamas leaders were permitted to travel freely across the Egyptian border and were welcomed in Cairo as legitimate political rulers.

Morsi also eased some restrictions on travel of everyday people in and out of Gaza, and personally sponsored a cease-fire last November between Israel and Hamas after eight days of heavy fighting. In a show of solidarity, Morsi sent his prime minister to Gaza during the fighting.

Not everything that Morsi did was to Hamas' liking, however. He carefully preserved Egypt's 1979 peace treaty with Israel, despite his personal hostility toward the Jewish state. And in recent weeks, Egyptian forces have cracked down on the smuggling tunnels to contain militant groups operating in the area. The crackdown has resulted in shortages of certain key goods, including fuel and cement.

Nonetheless, Morsi, as leader of the Arab world's largest and most powerful nation, was widely seen as a friend to Gaza and an important symbol of hope that Islamist groups would spread their influence across the region in the wake of the Arab Spring uprisings.

Late Wednesday, the Egyptian military toppled Morsi, saying it had acted in the name of millions of Egyptians who believed that Morsi had warped the democratic process and abused his power. The crackdown continued Thursday with the arrests of top Muslim Brotherhood figures, including its supreme leader.

Everyday Gazans greeted the news of Morsi's downfall with a mixture of resignation and trepidation.

"We as Palestinian people, whatever the Egyptian people want, we support them," said Gaza resident Maher al-Kitnani. "We are not with the government, we are with the people."

But Said Dukhan, a vegetable grocer in Gaza City, said he feared for Gaza's future.

"Egypt is our gateway to the world, so there is no doubt that anything that happens there will affect us here," he said. "Egypt has responsibilities toward Gaza and any leader should keep this in mind. Otherwise, we will suffer."

Hamas seized control of Gaza after several days of fighting against Palestinian President Mahmoud Abbas' Fatah movement. The Palestinians have been divided between two rival governments since then, Hamas in Gaza and the Fatah-dominated Palestinian Authority in the West Bank. The Palestinians seek to build a state in both territories, located on opposite sides of Israel, but repeated attempts at reconciliation have failed.

Fatah officials did little to conceal their happiness over the Muslim Brotherhood's failure in Egypt, and even expressed hope that it would lead to a collapse of the Hamas government as well.

"We salute the Egyptian people who have expressed their will," said Tawfiq Tirawi, a senior Fatah official in the West Bank.

"I think this is the end of the Muslim Brotherhood project" across the region, he added. "It's time for us to return Gaza and reunite our country, which was split by the hands of the Muslim Brotherhood. It's now much easier than during Morsi."

In Israel, leaders and military officials were closely following the developments in Egypt but declined to comment publicly.

Earlier this week, as the turmoil was unfolding, Prime Minister Benjamin Netanyahu refused to take sides, saying only that he hoped Egypt would keep the peace with Israel.

The 1979 treaty has been a critical component of Israeli security, allowing the military to divert resources to volatile fronts with Syria, Lebanon and the Palestinians. Israeli officials say security cooperation between the two militaries has remained strong during the Morsi era and even during the past few days of unrest.

Efraim Halevy, a former director of Israel's Mossad intelligence service, said the ouster of Morsi could spell trouble for the Muslim Brotherhood across the region.

"What happened now is that in the pan-Arab view a change has taken place, and it could be that a bigger change will happen in everything related to a general Islamic campaign in different countries in the Middle East," he told Israel Radio. "I think it is very important to pay attention to this aspect and not just the internal Egyptian aspect."

---

Mohammed Daraghmeh in Ramallah, West Bank, and Ian Deitch in Jerusalem contributed to this report.