A Cairo court ruled on Tuesday the government must destroy all tunnels between Egypt and the Gaza Strip, removing a route for smuggled weapons but also a lifeline for Palestinians.

Egypt's ruling Muslim Brotherhood has close ties with the Hamas Islamists that run Gaza, but many Egyptians fear the enclave is a security risk for Egypt. Leftist lawyers said they brought the case with activists to force the government's hand.

President Mohamed Mursi's national security adviser Essam Haddad has said Egypt will not tolerate the two-way flow of smuggled arms through the tunnels that is destabilizing its Sinai peninsula.

Egyptian forces flooded some of the tunnels earlier this month.

“The court ruled to make it obligatory that the government destroys the tunnels between Egypt and the Gaza Strip,” Judge Farid Tanaghou said.

An estimated 30 percent of goods that reach Gaza's 1.7 million Palestinians come through the tunnels, circumventing a blockade imposed by Israel and Egypt for more than seven years.

“I filed the case because I was worried about the state of national security in my country after the rise of the Muslim Brotherhood to power and its unclear policies and links with Hamas,” said Wael Hamdy, a lawyer who brought the case.

He said the case had been brought after 16 Egyptian border guards were killed last August by militants near the Gaza border that highlighted lawlessness in the Sinai desert region adjoining Israel and Gaza.

Cairo said some of the gunmen had entered Egypt through the Gaza tunnels, an accusation denied by the Palestinians. Dozens of tunnels have been destroyed since that incident, but, according to Hamdy, 2,000 are still open.

Reporting by Yasmine Saleh; Editing by David Stamp and Alison Williams