Military attack helicopters rattle over the impoverished desert towns of northern Sinai and the sound of gunfire erupts nightly, raising fears among residents of a looming confrontation between Egypt's military and Islamic militants who have intensified attacks since the ouster of President Mohammed Morsi.

Militant groups have grown bolder, striking security forces almost daily and also turning on local Christians. Some are now openly vowing to drive the military out of the peninsula on the borders with Israel and Gaza and establish an "Islamic emirate." Further fueling the turmoil is the longtime resentment among many in the Bedouin population over decades of neglect and harsh security crackdowns by the state.

The military and security forces have widened their presence, and military intelligence officials told The Associated Press an offensive is being planned, but no further details were given.

In a rare move, the Egyptian military sent a helicopter across the border to fly over the southern end of the Gaza Strip early Friday. Egyptian security officials said it was intended as a warning to its Hamas rulers amid concerns that Gaza militants are trying to cross to back those in the Sinai. The security and intelligence officials spoke on condition of anonymity because they were not authorized to talk to the press.

Israeli security officials say their military has not taken any special precautions, but it is watching the situation carefully. They say they remain in close contact with their Egyptian counterparts, and that Egypt has coordinated its security moves in Sinai with Israel, as required by their 1979 peace treaty.

"The situation is not secure. It is better to be home than to go out into the street," said Moussa el-Manaee, a resident in the northern Sinai town of Sheikh Zuweyid, which has a heavy presence of jihadi groups. "I am afraid to ride my car and catch a stray bullet."

Sinai has been the most lawless corner of Egypt since the ouster of autocrat Hosni Mubarak in early 2011, with increased violence. Police stations were torched and security forces kicked out of tribal areas where they were notorious for abuses. Shootings took place regularly on police and military outposts.

But after the military deposed the Islamist president on July 3, militant groups have lashed out.

In the past 10 days, at least eight security officers have been killed, the most recent on Friday. Two Christians have also died, one a priest. A gas pipeline to Jordan was bombed, ending a lull in such strikes.

Gunmen carried out a bold attack on the military section of an airport in the northern Sinai capital of el-Arish. They also opened fire on the convoy of the commander of the 2nd Field Army, who escaped, but a 5-year-old girl was killed in the subsequent gunbattle.

Morsi supporters around the country are protesting to demand his reinstatement, saying the army's ouster of the country's first freely elected leader has wrecked democracy. His removal came after millions around the country joined anti-Morsi protests.

For militants in Sinai, however, restoring Morsi is not the priority — they have said their goal is to drive out the military and the authority of the central government. His removal, however, took away a leader seen as reining in security crackdowns.

"Morsi had given them cover to a certain extent," said Ahmed Salama, who works for a leading civil society group in northern Sinai. Now extremists fear "the army can go after them," and at the same time "they see this as an opportunity to kick the army out of Sinai."

Shortly after Morsi's was removed from office, thousands held a rally in northern Sinai proclaiming over loudspeakers the formation of a so-called "war council." They proclaimed that "the era of peace is over" and vowed security forces would be expelled.

"Ansar al-Shariah wants to create an Islamic Emirate," said al-Manaee, a businessman with tribal links to extremists, referring to one of the militant groups operating in the area.

Extremist groups in Sinai had a complicated relationship with Morsi. The groups reject as too moderate the ideologies of his Muslim Brotherhood and even of the ultraconservative Salafis, viewing their participation in elections as heresy. Instead, they demand imposing a strict implementation of Shariah.

Salafis often mediated with militants and urged them to give the president a chance. The Salafis have wide influence in Sinai, and many of them sympathize with the extremists' goals, if not their violent methods.

At the same time, Morsi warned against heavy security crackdowns that fueled local outrage in the past, preferring negotiations and promises of development. Critics accused him of being reluctant to go after militants for fear of alienating ultraconservative allies, while locals say his government failed to improve the quality of life in Sinai.

The approach emerged in two major attacks the past year. Last Ramadan — in August — just weeks after Morsi took office, gunmen killed 16 Egyptian soldiers, stole armored vehicles and drove into Israel to attempt an attack there. The military responded with a major security operation in Sinai.

Soon after, Morsi said security forces had a chance to strike at suspects but did not in order to avoid killing civilians. The suspects have not been named and remain at large.

Then in May, militants kidnapped six policemen and a border guard. Morsi vowed to track them down but also warned against a heavy hand that could hurt the captives or the captors. After a week, the seven were freed, apparently after Salafi mediation. The kidnappers were never caught.

Brotherhood officials say any Sinai anger over Morsi's removal is because of public support for his policies. His government repeatedly announced increased development funds to the peninsula.

Brotherhood spokesman Gehad el-Haddad said Morsi worked to reverse decades of state neglect.

Sinai residents "felt as if they were Egyptian citizens and that there was a functioning state delivering services to them," he said, adding that the army broke the people's trust when they "wiped out" the democratic process.

At a pro-Morsi rally in Cairo, prominent Brotherhood figure Mohammed el-Beltagy told the crowd that "what is happening in Sinai as a result of the military coup will stop the second that (army chief) Abdel-Fatah el-Sissi announces a reversal of the coup, fixes the situation and the president is reinstated."

That is echoed by Asad el-Beyk, a Morsi supporter in Sinai who calls for peaceful protests. He runs a privately-owned Shariah Court in el-Arish that rules on disputes for those who want decisions based on Islamic law rather than civil courts.

"The entire situation in the country will not stabilize until Morsi is reinstated," he said.

However, al-Manaee, from Sheikh Zuweyid, said the ousted government's policies brought little improvement for residents.

"I respect Morsi, but in Sinai he didn't do anything," al-Manaee said.

The towns dotting the arid, mountainous Sinai have long been neglected, with investments directed to tourist cities along its southern Red Sea coast. The northern stretch along the Mediterranean relies heavily on smuggling, including trafficking of migrants and drugs, and trade through underground tunnels to Gaza.

Egypt had closed its border crossing with Gaza for 10 days after Morsi's ouster and clamped down on tunnels. It re-opened the border for limited hours earlier this week.

Egyptian military intelligence officials said they are keeping a close watch on extremist brigades in Gaza close to Hamas. They said Israel has been providing intelligence on the groups' movements. They spoke anonymously because they were not authorized to release the information.

Hamas official Salah Bardawil denied the group is interfering.

"We are concerned about Egypt's security and a stable and strong Egypt means stability for us," he said.

But the military faces the same dilemma as in the past: a heavy crackdown risks further alienating Sinai's population.

"We are likely to see just security measures being taken," said Brookings Institute analyst Khaled Elgindy. "The problems in Sinai are much deeper; they relate to governance, economics, development."


Ashraf Sweilam in el-Arish, Egypt, Tony G. Gabriel in Cairo, Ian Deitch in Jerusalem and Ibrahim Barzak in Gaza City, Gaza contributed reporting.