A Cairo court has ordered a ban on activities by the Palestinian Islamist group Hamas in Egypt, branding it a terror organization. The court also ordered that Hamas offices in the country be shut down and all dealings with the group suspended.

Hamas blasted the move as “an attempt to besiege the resistance.” A senior Hamas official told the AFP that the ban “serves the Israeli occupation.”

Egypt’s interim leaders maintain that Hamas is playing a key role in the insurgency by militants in the northern region of the Sinai Peninsula, which borders Hamas-ruled Gaza and Israel.

In Gaza, senior Hamas official Izzat Rishq condemned the ruling, saying the movement viewed it as a “political decision” directed against the Palestinian people and their resistance. His comments came in a statement sent by email.

Tuesday’s ruling by the Court of Urgent Matters was the result of a case brought before the court by an Egyptian lawyer seeking a verdict branding Hamas a terrorist organization and suspending any dealings with it. The ruling did not directly declare the group a terrorist organization.

Egyptian Foreign Minister Nabil Fahmy, addressing a previously scheduled news conference, said he was not aware of the ruling, but added: “anybody who take any actions that have implications on our security, are of concern to us,” he said when asked about when asked about Egyptian-Hamas relations “if you don’t take actions, we will treat you as Palestinian nationals.”

Samir Sabry, the lawyer who filed the case, said the ruling meant that any Hamas member currently in Egypt has now lost any legal cover for his stay and should be arrested.

Egypt’s relations with Hamas have sharply deteriorated since the military removed Islamist leader Mohammed Morsi last July. Hamas, which rules neighboring Gaza Strip, is a Palestinian offshoot of Morsi’s Muslim Brotherhood movement.

Morsi and scores of Brotherhood leaders are in detention, facing a multitude of trials on charges that carry the death penalty.

Two of those cases involve Hamas members, accused of assisting Morsi and others in escaping from prison in 2011. Morsi and others are also charged in a separate trial of leaking state secrets to Hamas.

Since the military regained power in Egypt, it has moved to severely curtail militant Islamic activity in the country and is engaged in an ongoing struggle against terrorists in the Sinai Peninsula. Egypt has also engaged in a campaign to destroy smuggling tunnels between Gaza and Sinai that Hamas uses to bring in supplies, weapons and other items.

>Earlier this week, Hamas accused Egypt of “allying with the [Israeli] occupation” by discussing the appeal to classify it as a terror organization.

On December 25, the military-backed Egyptian government declared the Muslim Brotherhood a terror group, having toppled its government six months earlier. Hamas said it was the first time in history that an Arab court would discuss such a claim, calling it “a violation of all national norms.”

“Classifying Hamas as a terror organization is a Zionist classification,” Hamas charged in a press release posted on its website Sunday. “The tendency of some to adopt such a classification expresses an alliance with the occupation and support of it … what is expected of our nation is to support the Palestinian resistance, not try it.”

In addition to Israel, the United States, Canada, the European Union and Japan all include Hamas in their lists of terror organizations.