Despite a two-year campaign, Egypt is facing an increasingly powerful and sophisticated insurgency in the Sinai Peninsula and the jihadist hotbed is emerging as President Abdel Fattah al-Sisi's biggest challenge.
The arid and rugged peninsula bordering Israel and the Gaza Strip has long been a breeding ground for militancy, especially from Bedouin tribes who have complained of being marginalised by Cairo.
But attacks have multiplied since Sisi's overthrow of Islamist president Mohamed Morsi in July 2013 and this week has seen some of the deadliest yet.
Fighters from the Islamic State group's Egyptian affiliate launched an unprecedented wave of brazen attacks on Wednesday in the North Sinai town of Sheikh Zuweid.
Police and soldiers fought fierce battles with the militants and the army sent F-16 warplanes to bomb IS positions.
After hours of fighting at least 70 people, mostly soldiers, were dead, according to medics and security officials. The military said in a statement that 17 soldiers and 100 militants were killed.
"Wednesday's attacks are unique... in their intensity, number, quality and force," said Mathieu Guidere, a professor of Arab geopolitics at France's Unfiversity of Toulouse.
Sisi, then chief of the army, came to power in 2013 vowing to restore security after a year of divisive rule by Morsi, Egypt's first democratically elected president.
His police crackdown targeting Morsi's Muslim Brotherhood has left hundreds dead, thousands imprisoned and hundreds more sentenced to death.
Jihadists have launched a series of attacks across the country in response, including bombings in Cairo and attempted assaults on tourist sites.
On Monday Egypt's top prosecutor Hisham Barakat, a key figure in the judicial crackdown on Islamists, was assassinated in a Cairo car bombing.
- 'Strategic and operational failure' -
But it is in Sinai that the insurgency has been most deadly.
Scores of police and soldiers have been killed, undermining the military's ability to stamp out the insurgency.
A deadly attack in October prompted the military to impose a state of emergency and curfew in parts of North Sinai, and it razed hundreds of homes to create a buffer zone along the border with the Gaza Strip to prevent infiltration of militants.
Sisi even shook up the army command in the peninsula after another attack in February that left dozens of soldiers dead.
Signup to our newsletter and follow us on Facebook and Twitter!
Analysts say Wednesday's violence shows these efforts are having little effect.
"The attacks in Sinai clearly demonstrate the strategic and operational failure of the security forces in countering insurgency," said Michael Wahid Hanna, an Egypt expert with the New York-based The Century Foundation think tank.
If anything, experts said, the jihadists in Sinai are growing stronger, thanks in large part to their alliance with IS.
Led by shadowy cleric Abu Osama al-Masry, the militants in Sinai have long taken advantage of the peninsula's tough mountainous terrain and won some support from local Bedouins.
"The political alienation of Sinai from mainland Egypt has been a key factor for the insurgency to grow," Hanna said.
In November the main jihadist group in Sinai, Ansar Beit al-Maqdis, pledged allegiance to IS, becoming one of the first jihadist groups outside Syria and Iraq to do so.
- Boost from joining IS -
In the months since, the so-called "Sinai Province" of IS has become one of the group's most powerful branches.
"IS has about 2,500 fighters in Sinai... The group is growing fast. Last year it had about 1,000 fighters. Many of them are also Egyptians returning from Syria and Iraq," Guidere said.
"It's clear that Egyptian fighters (in IS) are back from the Syrian and Iraqi fronts and are helping others benefit from their combat experience," he said.
Some are also bringing weapons, adding to the insurgents' armoury bought on the black market or seized from Egyptian forces.
Wednesday's fighting saw the militants using sophisticated tactics, for example taking over rooftops and firing rocket-propelled grenades at a police station in Sheikh Zuweid after mining its exits to block reinforcements.
"The Egyptian army is not prepared to face an Islamist guerrilla that is highly organised and well-trained," Guidere said.
"The groups need to be chased by special forces and what the army is doing is that it is deploying regiments. It's crazy. What is required are special forces who operate just like the guerrillas. Sending F-16s does not work."
Egypt has promised an even harder crackdown on jihadists and on Wednesday adopted a new law toughening punishments for "belonging to a terrorist group".
This week's attacks "will reinforce populist support for more repressive measures," Hanna said.
But in Sinai such measures are not likely to have much of an effect, said Zack Gold of the American Security Project think tank.
"Unfortunately, policies such as curfews, sieges, and the Gaza buffer zone have a more negative impact on the civilian population of Sinai than they do on the militants," he said.