CAIRO — After militants massacred 305 people at a packed mosque on Friday in a stunning assault on a sacred place, President Abdel Fattah el-Sisi responded as he knows best.
Mr. Sisi went on television vowing to “take revenge” and strike back with an “iron fist.” Moments later, Egyptian warplanes swooped over the vast deserts of the Sinai Peninsula, dropping bombs that pulverized vehicles used in the assault. Soldiers fanned out across the area.
But that furious retaliation, which follows years of battle in Sinai against a vicious Islamic State affiliate that downed a Russian passenger jet in 2015 and has regularly attacked Egyptian security forces there, revived the most troubling question about Mr. Sisi’s strategy in the desert peninsula: Why is it failing?
One of the most striking aspects of the carnage that unfolded on Friday, the deadliest terrorist attack in Egypt’s modern history, was how easy it was for the militants to carry it out. In a statement issued on Saturday, Egypt’s prosecutor general, Nabil Sadek, described the grisly scene in forensic detail.
Between 25 and 30 gunmen, traveling in five vehicles and carrying an Islamic State flag, surrounded a Sufi mosque on all sides in Bir al-Abed, a dusty town on a road that arcs across the sandy plain of North Sinai.
After an explosion, they positioned themselves outside the main entrance of the mosque and its 12 windows, spraying the worshipers with gunfire. Seven parked cars were set ablaze to prevent victims from escaping. Among the dead were 27 children.
For Sinai residents, the attack deepened an abiding sense of dread about life in a part of Egypt where many feel trapped between barbarous militants and a heartless military. At a hospital in nearby Ismailia, survivors recounted how they leapt through windows as militants raked them with gunfire, or of watching their friends and relatives die.
“If even mosques are being targeted, then where are we safe?” said Mohamed Abdel Salam, 22.
For Sinai experts, the assault sharpened scrutiny of Egypt’s counterinsurgency tactics against a dogged Islamist insurgency that has surged in strength since 2013, after Mr. Sisi came to power in a military takeover.
They paint a picture of a stubbornly outmoded approach that is unsuited to the fight, and that perpetuates the mistakes of successive Egyptian leaders.
For decades Egypt has seen Sinai through a military prism, taking an aggressive approach to an alienated local population. The military has engaged in summary executions and the destruction of whole villages, while offering little to solve the region’s deep social and economic problems, including chronic unemployment, illiteracy and poor access to health care.
Egyptian soldiers and conscripts are hunkered down inside heavily protected bases, venturing out in armored convoys that barrel down long, exposed roads.
Those roads are filled with check posts manned by nervous soldiers, many of them conscripts. The insurgents, some with roots in Sinai’s long tradition of smuggling, skirt through the desert.
“The Egyptians have failed to acknowledge that ISIS is not just a terrorism threat,” said Andrew Miller, a former Egypt specialist at the National Security Council, now at the Project on Middle East Democracy in Washington. “Killing terrorists is not sufficient. They need to deprive ISIS of local support, which is rooted in Cairo’s historical neglect of the Sinai.”
But that support has been eroded by multiple accounts of torture and extrajudicial executions by the military, as well as indiscriminate military tactics that often inflict civilian casualties and sow widespread resentment.
“The military has never cared for civilian losses,” said Mohannad Sabry, author of a book on Sinai. “The excessive and reckless use of force has killed entire families. We’ve seen airstrikes blow people up in their homes. We’ve seen villages razed off the face of the earth. That tells you something about how they see Sinai society.”
Over the past year, Mr. Sisi has welcomed a line of foreign leaders to Cairo, where he signed deals for billions of dollars in advanced military equipment: German submarines, Russian combat helicopters, a French aircraft carrier and a military satellite. American military officials have tried quietly to persuade him to allocate his resources, including $1.3 billion in annual American aid, to tools and techniques better suited to fighting the insurgency in Sinai, like equipment and training for intelligence gathering.
But Mr. Sisi, they say, is not listening, and his generals prefer to buy tanks, jets and other heavy weapons for their bases around the Nile.
“They understand they have got a problem in Sinai, but they have been unprepared to invest in the capabilities to deal with it,” said Steven Simon, a professor at Amherst College and a former senior director for the Middle East and North Africa on the National Security Council.
One person who did have some sway over Mr. Sisi was Egypt’s chief of defense staff, Mahmoud Hegazy. American officials saw him as the only person in Mr. Sisi’s inner circle with the authority to publicly contradict him, a former United States official said. They also had a personal bond: General Hegazy’s daughter is married to Mr. Sisi’s son.
The move dismayed senior State and Defense Department officials who saw General Hegazy as a check on Mr. Sisi in a circle of advisers that has become ever smaller and, some fear, ever more sycophantic, said the former official, who spoke anonymously to protect internal deliberations on an important ally that rarely receives public criticism well.
Sinai presents a formidable arena for counterinsurgency that would challenge the most capable army: It is a vast terrain of desert and mountains, with long shorelines and a semiporous back door across the border into Gaza, which has been controlled by Hamas.
The collapse of Libya in 2011 has ensured a steady flow of weapons ever since, some from the depots of the deposed Libyan leader Muammar el-Qaddafi. In the past year, as the Islamic State’s vision of a caliphate in Syria and Iraq has crumbled, experts have fretted about an influx of returning Egyptian jihadis, bent on bringing their fight back home.
So far, American officials say, a relatively small number of fighters have returned. But the collapse of Raqqa and Mosul has precipitated a sharp shift in the Islamic State’s tactics in Sinai, with a greater emphasis on attacks against soft targets, like Coptic Christians and Sufis, in a bid to undermine Mr. Sisi by sowing sectarian hatred in Egyptian society.
Little of Egypt’s fight against the Islamic State in Sinai is visible to the outside world, or even most Egyptians. Foreign reporters and most Egyptian ones are not allowed into Sinai. Concrete information about the conflict is hard to come by: On its Facebook page, the Egyptian military claims to have killed at least 3,000 Islamist militants, far more than the hundreds it once estimated were there.
A leaked videotape last April depicted those claims in a very different light. It showed a military unit, made up of Sinai locals and accompanied by senior army officers, executing detainees — local men in jeans — on a desolate patch of ground in Sinai. Earlier, on its Facebook page, the army had claimed the men died in a shootout.
Amnesty International, which confirmed the video’s authenticity, said it was consistent with a pattern of military-led abuses it has documented in Sinai.
In private, Mr. Sisi’s officials argue that they don’t need to take lessons from the Americans. They point to what they say is a failure of American counterinsurgency ventures in Iraq and Afghanistan. And they add that their methods worked in the 1990s and 2000s, at least temporarily and in other parts of Egypt, when President Hosni Mubarak authorized harsh measures to disarm militants who attacked Western tourists at historical sites.
“They look back and say: This is how we did it, and it worked,” said Zack Gold, a Sinai expert at the Hariri Center at the Atlantic Council. But, Mr. Gold added, the conditions are radically different in North Sinai, where residents have suffered years of neglect and mistreatment from the Egyptian mainland.
Sinai residents complain of feeling isolated, even culturally distant, from the Nile Valley where the vast majority of Egyptians live. Many in the North Sinai refer to other Egyptians as “people of the valley,” as though they were citizens of another country. Some speak nostalgically of more effective governance when the peninsula was under Israeli control, between the Israeli seizure of the area in the Six Day war in 1967 and its return to Egypt in 1982.
The Bedouin tribes who live there, often portrayed as outlaws in Egyptian popular culture, say they feel greater kinship with the tribes in Gaza — a connection that has bred longstanding suspicion among officials in Cairo, especially since the Israeli occupation.
South Sinai, around Sharm el Sheikh, and Mount Sinai developed into a tourist destination. But the North remained loosely governed and some of the tribes who lived there considered smuggling a birthright, and resented Cairo’s attempts to restrict it.
“Many Egyptians west of the Suez don’t consider the Bedouin to be fully Egyptian,” Mr. Miller, the analyst, said. “They have poorer educational and employment opportunities, and they are largely shut out of government jobs and the security services.”
Cynicism about the central government was evident outside the Ismailia hospital on Friday, where an elderly Bedouin woman in black sat on the muddy lawn, huddled under a blanket for warmth. She refused to give her name, citing fear of reprisals from either the military and Islamic State. “If either side sees our names, they will kill us. They are as bad as each other,” she said.
“The military will keep jailing and killing local young people. The terrorists who hate us and the Christians will keep using it as an excuse to kill us,” she added. “There is no point in talking about anything.”
Follow Declan Walsh on Twitter @declanwalsh and David Kirkpatrick @ddknyt
Declan Walsh reported from Cairo, and David Kirkpatrick from London. Nour Youssef contributed reporting from Ismailia, Egypt.
Sign up for The Interpreter
Please verify you’re not a robot by clicking the box.
Invalid email address. Please re-enter.
You must select a newsletter to subscribe to.
* Required field
Thank you for subscribing.
View all New York Times newsletters.
An error has occurred. Please try again later.
You are already subscribed to this email.
View all New York Times newsletters.
Tony Hovater, a 29-year-old welder, helped form a pro-Nazi group that marched in Charlottesville.
A State Department exodus marks a new stage in the broken and increasingly contentious relationship between Rex W. Tillerson and much of his work force.
Senator Mitch McConnell and his allies have been infuriated as President Trump has reacted with indifference to a series of ideas they have floated to try to block Mr. Moore.
The crown prince has big plans to bring back a level of tolerance to his society.