Mohamed Morsi was forced to respond quickly to his first security crisis as Egypt’s first freely elected president. After 16 Egyptian soldiers were killed by gunmen in the Sinai Peninsula last Sunday, he dispatched troops to secure the border, moved to assert control of his security leadership team and avoided conflict with Israel. It was a challenging beginning for an inexperienced leader who had been in office less than two months.  The crisis, of course, is far from over. Militants have operated in the largely lawless Sinai for years, but the region grew increasingly unstable after President Hosni Mubarak was toppled in 2011. Security and police forces retreated from the region, giving Bedouin criminals, Palestinian militants from neighboring Gaza and other militants wider rein.  Finally, violence exploded at the northern border, the nexus of Israel, Egypt and Gaza. Failure to prevent continued lawlessness would compound an already fragile situation and could conceivably unravel the 1979 Egypt-Israel peace treaty.  Much of what is happening is subject to speculation. On Wednesday, Egypt reportedly sent hundreds of troops and armored vehicles into the Sinai, while airstrikes by the military hit several targets. But it was not clear whether reports in the Egyptian news media that about 20 militants had been killed and nine others captured were factual or embellished to give the impression of a successful crackdown.  Similarly, the identity of the attackers who killed the soldiers as they were breaking their Ramadan fast has not been firmly established. Israel, among others, suspects the involvement of Al Qaeda-inspired militants with ties to Palestinians in Gaza. Egyptian leaders need to investigate thoroughly and be as transparent as possible about what they find and about the kinds of military operations they are carrying out.  On Wednesday, Mr. Morsi fired his intelligence chief, the top military police officer and the governor of North Sinai — a stunning purge of officials who had been seen as tied to the old order and/or blamed for security lapses that contributed to the deaths of the soldiers. But, again, it was not clear whether Mr. Morsi acted unilaterally or whether the shake-up was part of a deal with the generals — with whom he has been engaged in a power struggle — so both sides could avoid blame. Whatever the truth, Mr. Morsi is going to have to consider even broader reforms in his security service.  If Palestinian militants from Gaza were responsible for the attack, it would be a particular affront to Mr. Morsi, an Islamist. His party, the Muslim Brotherhood, is allied with Hamas, which rules Gaza, and he has made a special effort to work with leaders there. This relationship also makes his decision to shut down the tunnels used to smuggle food, household goods, weapons and militants themselves between the Sinai and Gaza, which is under Israeli blockade, so sensitive.  Israel has long viewed these tunnels as a threat. It is unclear how many of them Mr. Morsi intends to shut or for how long. He will be under heavy pressure from Hamas to keep them open because they are a vital link for consumer goods needed by Gaza citizens. Either way, a longer-term solution for Gaza is required.  Perhaps the most remarkable development, at this early stage, is the apparent lack of friction with Israel, which has not objected to Egypt’s ground-force buildup or the air missions, despite the fact that the Sinai was largely demilitarized by the 1979 peace treaty. Now that it is in power, the Muslim Brotherhood, which has a long history of antipathy toward Israel, may begin to appreciate the value of investing in mutual security.  Mr. Morsi and his government will have an even harder time dealing with Egypt’s many problems — including rebuilding a shattered economy and creating jobs — if it has to deal simultaneously with growing militancy in the Sinai. Egypt and Israel could be forced to finally figure out how to work together to confront extremism and improve border security.
The attack in the Sinai Peninsula has forced an inexperienced leader to confront competing interests to bring the situation under control.