The smuggling tunnels linking the Gaza Strip to Egypt are a security threat and must be destroyed, a Cairo court ruled on Tuesday, responding to a petition brought by a group of lawyers and activists in the wake of a cross-border attack that killed 16 Egyptian border guards in August.

That attack, which Egypt initially attributed to a Gazan offshoot of the ruling Hamas movement, also saw two Egyptian army vehicles commandeered by terrorists and driven across the Israeli border before being destroyed in an IAF airstrike.

“The court ruled to make it obligatory that the government destroy the tunnels between Egypt and the Gaza Strip,” Judge Farid Tanaghou wrote in his decision, according to Reuters.

Despite the Islamic Hamas’s historic ties to Egypt’s ruling Muslim Brotherhood, Egypt cannot tolerate a porous border that will continue to destabilize the Sinai Peninsula, Egyptian President Mohammed Morsi’s national security adviser Essam Haddad reportedly said.

Gaza, which is home to 1.7 million people, has lived with border restrictions by Israel and Egypt since the Hamas takeover of the territory in 2007. Smuggling under the 15-kilometer (9-mile) border has circumvented official crossings and bypassed restrictions for many years.

Israel restricts the influx of goods into the territory from its side of the enclave, so Gazans smuggle in construction materials, cars and fuel. Hamas also receives weapons and cash through the illegal tunnels. Hamas officials are known to collect fees from tunnel operators.

Lawyer Wael Hamdy instigated 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.”

Hamdy also said that despite recent efforts by Cairo to close some tunnels — according to The New York Times, Egypt has even attempted to flood them with sewage — around 2,000 remain active.

The Associated Press contributed to this report.