CAIRO, Egypt — A month after an Egyptian court ruled that Hamas’s armed wing, the Izz ad-Din al-Qassam Brigades, was a terror organization, another court on Saturday branded the entire group — including its political wing — with the same designation.

Since Egypt’s military ousted Islamist president Mohamed Morsi in 2013, the authorities have accused Hamas of aiding jihadists who have waged a string of deadly attacks on security forces in the Sinai Peninsula.

Hamas slammed the decision calling it a “stain on Egypt’s reputation.”

Hamas spokesman Sami Abu Zuhri said the ruling has turned the Palestinian people into the enemy of Egypt and Israel, its friend. He accused the Egyptian court of trying to blame outside forces for the internal unrest.

Last week, state-run newspaper al-Ahram accused Hamas and the Muslim Brotherhood of conspiring to overthrow the Egyptian regime within the next few years.

The newspaper quoted “informed sources” who accused Hamas’s military wing of coordinating plans with the Brotherhood to hit Egyptian military targets and vital installations and distribute footage of the attacks in order to lower national morale. They claimed that the two groups planned to spread rumors of an Islamic State presence in Egypt in order to sow panic among the population.

Hamas and the Brotherhood thus hoped to spread fear and disappointment with the Egyptian armed forces, the sources alleged, while also working behind the scenes, using agents in the government to disrupt internal services and erode trust in the regime.

On February 6 hundreds of Palestinians demonstrated outside Egypt’s diplomatic mission in Gaza City to protest the ruling outlawing Hamas’s armed wing. Protesters waved green Hamas flags and chanted in support of the Izz ad-Din al-Qassam Brigades: “Qassam are the pride of the nation, not terrorists!”

In early January, Egypt began work on doubling the width of a buffer zone along the border with Gaza to prevent militants infiltrating from the enclave. The buffer zone was created following a suicide bombing on October 24 last year that killed 30 Egyptian soldiers and wounded many others.