CAIRO (AP) — At least seven civilians were killed when a shell mistakenly hit a home in the restive northern part of Sinai Peninsula, Egyptian officials said late Wednesday.

It was not immediately clear which side fired the shell in Abuel-Lehteni village in the coastal city of el-Arish.

Security forces thwarted attacks on at least five police checkpoints, including one outside the only church in the city, the officials said, adding that at least two militants were killed and a policeman wounded.

The officials spoke on condition of anonymity because they were not authorized to brief reporters.

Egypt has battled Islamic militants for years in the Sinai Peninsula in an insurgency that has occasionally spilled over to the mainland, striking minority Christians and occasionally tourists. The insurgency grew deadlier and militant attacks more frequent after the military’s 2013 ouster of an elected but divisive Islamist president, Mohammed Morsi.

At the center of the conflict is an Islamic State affiliate based in Sinai. The Egyptian militant group swore allegiance to IS at the height of its power in Iraq and Syria in 2014. IS has now been mostly defeated and all the territory it once controlled in both Syria and Iraq taken back and liberated.

In Egypt, an all-out campaign by the military since early 2018 has mainly halted high-profile attacks by IS and other militants.

Wednesday’s incident came a day after seven policemen, including an officer, were killed also al-Arish. A local affiliate of the Islamic State group claimed responsibility for those attacks on police checkpoints. The Interior Ministry said eight policemen were wounded and four militants killed, including a suicide bomber after his explosives were set off.