Militants attacked a crowded mosque during Friday prayers in the Sinai Peninsula, settling off explosives, spraying worshippers with gunfire and killing at some 305 people in the deadliest ever attack on Egyptian civilians by Islamic extremists.

MENA, a state news agency, reported that ISIS-affiliated militants are suspected of perpetrating the attack, which targeted a mosque frequented by Sufis, members of Islam's mystical movement, in the north Sinai town of Bir al-Abd. Islamic militants, including the local ISIS branch, consider Sufis heretics because of their less literal interpretations of the faith.

Egypt's military has begun conducting airstrikes around the area, security sources and eyewitnesses said. The strikes have been concentrated in several mountainous areas surrounding Al-Rawdah mosque where militants are believed to be hiding out, the security sources said.

The local ISIS affiliate has been waging a stepped-up campaign of violence in northern Sinai for years and has claimed deadly bombings on churches in the capital, Cairo, and other cities, killing dozens of Christians. It also is believed to have been behind the 2016 downing of a Russian passenger jet that killed 226.

But this was the first major militant attack on a Muslim mosque and the startling bloodshed eclipsed any past attacks of its kind, even dating back to a previous Islamic militant insurgency in the 1990s.

The militants opened fire from four off-road vehicles on worshippers inside the mosque during the sermon, blocking off escape routes from the area by blowing up cars and leaving the burning wrecks blocking the roads, three police officers on the scene said.

Victims including some 130 wounded were rushed to local hospitals, they added, speaking on condition of anonymity because they weren't authorized to brief reporters.

No one claimed responsibility immediately following the attack, but ISIS has targeted Sufis several times in the area in the past, notably beheading a leading Sufi religious figure, the blind sheikh Suleiman Abu Heraz, last year and posting photos of the killing online.

Images circulating on social media showed dozens of bloodied bodies wrapped up in sheets laid across the mosque floor, while others revealed dozens of relatives queuing up outside the hospital as ambulances raced back and forth.

Resident Ashraf el-Hefny said many of the victims were workers at a nearby salt firm who had come for Friday services at the mosque, which had contained some 300 worshipers.

"Local people brought the wounded to hospital on their own cars and trucks," he said by telephone.

Egypt's state news agency reported the casualty toll, citing "official sources," revising it upward several times following the officials' initial reports.

MENA reported that Egypt's presidency declared a three-day mourning period, as President Abdel-Fattah al-Sissi convened a high-level meeting of security officials.

Cairo's international airport boosted security following the attack, with more troopers and forces seen patrolling passenger halls, conducting searches and manning checkpoints at airport approaches.

State condolences poured in for Egypt, including messages from Israel, the United Arab Emirates, the U.S., Russia, France and Britain condemning the violence.

Security forces have been battling militants in northern Sinai for years, but attacks to date have focused on military and police assets, although assassinations of individuals ISIS considers government spies or religious heretics are not uncommon.

Hundreds of soldiers and militants have been killed in the conflict, although exact numbers are unclear as journalists and independent investigators are banned from the area.

Egypt is also facing a growing number of attacks by militants in its Western Desert, including an attack last month that killed 16 police, according to an official tally issued by the Interior Ministry. Security officials have told journalists that dozens more, including high-ranking counterterrorism officers, perished in the Oct. 20 attack some 135 kilometers (84 miles) southwest of the capital, Cairo.