The Egyptian army is digging a trench in northern Sinai along the border with Gaza in an effort to prevent smuggling, security sources said on Monday, as the government steps up activities to prevent militant attacks that often target security forces. Egypt had already doubled to 1 kilometer (0.6 miles) the depth of a security buffer zone on its border with the Gaza Strip after some of the worst anti-state violence since former President Mohammed Morsi was overthrown by the army following mass protests against his rule in 2013. Authorities are still battling an insurgency in which the most active group, Wilayat Sinai ("Sinai Province"), has pledged allegiance to the Islamic State group. Hundreds of police and soldiers have been killed in the attacks, which have surged since the army ousted Morsi. President Abdel-Fattah el-Sissi has described Islamist militant groups as an existential threat to Egypt, the most populous Arab country. The trench would help detect more tunnels used in the smuggling trade, which Egyptian authorities see as a threat. Once the trench is dug, no vehicle or person will be able to pass except through the trench. Security sources said passages had been made for vehicles and for pedestrians. They said the U-shaped trench is 2 kilometers away from the border and will have a depth of 20 meters (66 feet) and a width of 10 meters. Egypt has kept its Rafah closing with Gaza largely shut since 2013 but has recently opened it for a few days. Cairo has accused Hamas of helping militants in Egypt's Sinai desert, which borders Gaza, to attack its security forces, a claim Hamas denies. An Egyptian court earlier this month, however, canceled a previous ruling labeling Hamas a terrorist group, a decision that was praised by Palestinian Islamists. Some residents have criticized the trench, saying it has choked traffic and has caused the destruction of vegetation, which many farmers in the area depend on.