The recent, brutal killings of Egyptian Coptic Christians in Libya by an ISIL-affiliate is likely to harden the Egyptian government's campaign in the east against militants of the so-called "Sinai Province", another ISIL-affiliated group formerly known as Ansar Beit al-Maqdis.

But from all indications this battle is unlikely to end soon. The terrorist group has been able to stage a number of attacks against beefed-up Egyptian security forces in the Sinai. In late January, for example, it killed 30 people, mostly members of the security forces, and injured at least 50 others.

This serious incident prompted Egyptian President Abdel Fattah el-Sisi to shake up the military in the Sinai, creating a unified command there under the leadership of General Osama Roshdy Askar who has been given the responsibility of guiding counterterrorism operations of the second and third armies in the peninsula.

Government response

On February 6, the government responded to the Sinai attack by reportedly killing a total of 47 militants in a day-long operation in the north Sinai region.

A week later, it unleashed air strikes against a terrorist stronghold near Rafah, close to the Egypt-Gaza border, reportedly killing a terrorist leader and seven of his cohorts.

Around this time, another terrorist group, Ajnad Misr - which may or may not be affiliated with Ansar Beit al-Maqdis - claimed credit for detonating an explosive device in Cairo's Ain Shams district, killing a police officer and injuring nine others, including a civilian.

Although the terrorists have been on the receiving end of many casualties and may have lost some ground in the Sinai - a year ago some areas of the peninsula were too dangerous even for Egyptian military patrols - they are likely to remain a thorn in the government's side for some time to come.

The reasons are multifaceted, having to do with the military tactics of both the terrorists and the government, as well as poor socioeconomic conditions facing the mostly Bedouin inhabitants of the Sinai.

First, Ansar Beit al-Maqdis or the Sinai Province has demonstrated that it is just as brutal as other ISIL-affiliated groups in its tactics - decapitating so-called informants and dumping their bodies by roadsides as a warning to others.

Chilling effect

These actions probably have had a chilling effect on those Bedouin who see the terrorists as an enemy and are inclined to help the security forces but are too scared to do so. This has likely limited the amount of intelligence on the terrorists that the security forces are able to receive.

Second, the Egyptian government has often used heavy-handed measures against whole Bedouin villages if it suspected that one or two of the villages' young people aided or joined the terrorists.

Security forces have also employed other draconian policies such as cutting down hundreds of olive trees by roadsides - purportedly because they give cover to terrorist ambushes - and demolishing hundreds of homes near Rafah.

Security forces have also employed other draconian policies such as cutting down hundreds of olive trees by roadsides - purportedly because they give cover to terrorist ambushes - and demolishing hundreds of homes near Rafah because it wants a "clear zone" near Gaza where they can better monitor terrorist activities and stop tunnels into Gaza.

These policies have had the unintended effect of probably creating more recruits for the terrorists than would otherwise be the case. The deaths of innocent Bedouin villagers in particular have likely caused many of their relatives to join the terrorist groups to exact revenge on the security forces.

One Egyptian military officer who has interrogated militants in the Sinai recently told a reporter for Reuters that: "One of them recalled how his brother was killed by the security forces. He described how his sister-in-law cried and urged him to take revenge or else he would look weak."

Underlying problems

An underlying problem is that the Bedouin of the Sinai have long been a neglected population group - receiving less government funds and services than mainland Egyptians - and suffer from high poverty and unemployment rates.

Relatively well-paying jobs in the Sinai are confined to the tourist sector in the southern part of the peninsula, and those positions are usually filled by mainland Egyptians.

That at least some Bedouin have earned a living by smuggling and other nefarious activities have reinforced the sentiment of many mainland Egyptians and security forces that they cannot be trusted. Bedouin are exempt from being drafted into the military and are prohibited from joining the police services, which also serves to set them apart from other Egyptian citizens.

To defeat the terrorists in the Sinai, the Egyptian government cannot rely on security crackdowns alone (and it needs a more nimble approach in this area to avoid civilian casualties), no matter how tempting it is to use brute force against ISIL-affiliated groups.

It must address the socioeconomic problems in the Sinai to give the Bedouin meaningful job prospects in order to dry up terrorist recruitment. This should involve extensive job training programmes, opening tourism and Sinai police force jobs to the Bedouin (albeit after proper vetting) and compensation for homes and agricultural areas destroyed in the counterterrorism campaign.

Otherwise, this campaign will go on without an end in sight.

Gregory Aftandilian is a former Middle East analyst at the US State Department and a former staff member of the Senate Foreign Relations Committee.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.