In this Nov. 6, 2014, file photo, an Egyptian army armored vehicle stands on the on the Egyptian side of border town of Rafah, north Sinai, Egypt. Islamic militants on Wednesday, July 1, 2015, unleashed a wave of simultaneous attacks, including suicide car bombings, on Egyptian army checkpoints in the restive northern Sinai Peninsula, killing dozens of soldiers, security and military officials said.(AP Photo/Ahmed Abd El Latif, El Shorouk Newspaper, File) (Ahmed Abd El Latif/AP)

Militants linked with the Islamic State unleashed a wave of attacks on the military in Egypt’s Sinai Peninsula on Wednesday, briefly seizing key checkpoints and signaling a bold new campaign by insurgents in one of the region’s most stable countries.

As many as 70 soldiers and civilians were killed in the fighting, officials and local media said. The army acknowledged late Wednesday that 17 soldiers and 100 militants had died in the clashes.

The assault was one of the most sophisticated attacks on the powerful army in decades, and it challenged Egypt’s efforts to portray itself as a bulwark of stability in a region awash in violence. While Egypt’s authoritarian government has crushed most opposition and reinforced the role of the military in recent years, Islamic State loyalists were able to nearly take control of a town of 60,000.

The attack came just two days after Egypt’s top prosecutor was assassinated in a bombing in the capital, Cairo.

The insurgency in Sinai has grown since Egyptian President Abdel Fatah al-Sissi ousted Islamist president Mohamed Morsi in 2013. In November, one of the area’s strongest militant groups pledged allegiance to the Islamic State.

The nature of Wednesday’s attack on the town of Sheikh Zuweid is “new and worrying,” said Zack Gold, a visiting fellow at the Institute for National Security Studies in Tel Aviv who specializes in the Sinai Peninsula.

The militants, now calling themselves the “Sinai Province” of the Islamic State, appeared to have shifted from their usual ­guerrilla-style tactics, he said.

“This isn’t one of their regular hit-and-run attacks. They seem to be setting up for the longer haul,” Gold said, adding that it was unclear Wednesday whether the group wanted to take the town or simply draw the military into urban warfare.

“Either one is unprecedented,” he said.

Sinai residents who were reached by phone or posted accounts on social media described panic in the region Wednesday. Two people, writing on Facebook, described hellish scenes of corpses on Sheikh Zuweid’s streets. Others said residents had used donkeys to transport the wounded to the nearest public hospital. Ambulances could not reach the city because of the intensity of the fighting, health officials told local media. Throughout the day, militants were perched on rooftops, firing on the town’s security installations, security officials said.

In June, an Islamic State spokesman called for a “month of fire” during the Muslim holy period of Ramadan, urging supporters to carry out attacks against nonbelievers around the globe. Since then, operations by the group’s affiliates or suspected sympathizers have shaken France, Kuwait and Tunisia.

Ambulances wait outside Arish Hospital, in North Sinai, Egypt. (Str/EPA)

On Wednesday, the Sinai Province group said it had attacked Egypt’s “infidel army” with car bombs and heavy weaponry at 14 military checkpoints and an army officers’ club near Sheikh Zuweid, about 115 miles northeast of Cairo. Militants launched the attacks just before 7 a.m. on Wednesday, the army said. The battles were still raging 12 hours later but finally subsided at night.

In a second statement, the extremist group claimed to have lined the perimeter of the Sheikh Zuweid police station with land mines. Local media said security forces battled for hours to break the siege at the station.

An army spokesman said Egyptian warplanes had carried out airstrikes on militant positions in Sheikh Zuweid.

Gold said the jihadists in Sinai are unlikely to succeed in holding terrain.

“Egypt isn’t Iraq; this isn’t Anbar,” he said, referring to the Iraqi province where Islamic State militants have seized major cities.

“The [Egyptian] military is more cohesive and has more firepower and has the capability to get them out,” Gold said of the militants. “The question is how many civilians will be harmed in the process.”

Egypt has for years grappled with unrest in the Sinai Peninsula, home to Bedouins, who are culturally and linguistically distinct from the population of mainland Egypt. The Bedouin tribesmen have long accused the central government of neglect, and they have trafficked in drugs and weapons for their livelihoods. The area’s proximity to Israel and the Gaza Strip has made the region a crucial conduit for weapons flowing to Palestinian militants.

Since 2011, Islamist militancy has thrived in Sinai’s desert regions, particularly in the north near the border with Gaza. Tribesmen routed police in Sinai during the Arab Spring revolt that year, leaving a security vacuum that jihadists exploited to establish safe havens. Militants acquired weapons smuggled out of neighboring Libya, whose authoritarian government was also toppled during the Arab Spring. The various groups in Sinai occasionally launched rockets into ­Israel or staged hit-and-run attacks on security forces.

The militants’ links with the Islamic State appear to have emboldened them further, even if it is not clear that the affiliation has furnished them with additional cash or weapons. Wednesday’s attacks also raised questions about the effectiveness of the military’s campaign in Sinai, where security agencies have conducted sweeping arrests but the jihadists still appear to freely operate.

“It’s never been this bad before,” a longtime of resident of Rafah, which is about 40 miles east of Sheikh Zuweid on the border with Gaza, said of the battles. The resident requested anonymity out of fear for his safety. In the afternoon Wednesday, two explosions were heard in Rafah, residents said.

“Everyone is in a state of panic,” the resident said. “The phone lines keep going down so we can’t call each other.”

Meanwhile, Egypt’s Interior Ministry said Wednesday that security forces had killed nine prominent members of the outlawed Muslim Brotherhood in an apartment in a Cairo suburb. It said the men were planning attacks.

The Brotherhood denied the charge. It said in a statement that the killings were “a turning point that will have its own repercussions.”

Following the assassination of state prosecutor Hisham Barakat on Tuesday, Sissi pledged to swiftly carry out sentences against Islamists on death row. A number of Muslim Brotherhood leaders, including Morsi, have been sentenced to death in trials that human rights groups have criticized as politically motivated.

Morris reported from Baghdad. Heba Habib in Cairo contributed to this report.

Insurgency takes root in Egypt’s Sinai

Egypt and UAE strike Islamist militias in Libya

Under Sissi, crackdown on human rights groups expands