Men walk past victims of the attack at the al-Rawda mosque in Bir al-Abd. (Stringer/AFP/Getty Images)

Militants set off a blast and gunned down fleeing worshipers at a packed mosque in Egypt's northern Sinai Peninsula on Friday, killing at least 235 people in the deadliest single assault on civilians by suspected Islamist extremists in Egypt's recent history.  

There was no immediate claim of responsibility for the attack, which survivors described as a sophisticated, terrifying and unprecedented assault on a mosque that was frequented by Sufi Muslims: an attack planned, it appeared, to ensure that none of the worshipers survived.

Egyptian security forces have struggled for years against an Islamic State affiliate based in the Sinai Peninsula that has killed hundreds of police and military personnel in an insurgency against the government of President Abdel Fatah al-Sissi. The government has worked to keep that war in the shadows, preventing journalists from accessing Sinai or the towns there that have become battlegrounds, amid frequent reports of militant atrocities and heavy-handed tactics by the army.

But the dangers of the conflict were impossible to conceal Friday, as the rising death toll was announced in grim updates on state television and Egyptians mourned the largest loss of life from a militant attack in decades. It surpassed the number of dead in the downing of a Russian airliner over Sinai in 2015 that was claimed by Islamic State-linked militants.  

As condolence calls poured in from world leaders, Sissi spoke on television, vowing that Egypt's armed forces would respond with "brute force."   

"We cannot be intimidated," he said. "Our will cannot be broken." After the attack, Egypt's military carried out airstrikes in northern Sinai concentrated in mountainous areas around the mosque, according to the Reuters news agency.

Egypt's militants have targeted Coptic Christian churches in the past, but strikes against mosques have been rare in recent years. Nonetheless, orthodox Sunni Muslims and militant factions consider Sufism, a mystical branch of Islam, to be heretical, and last year Egyptian Islamist militants beheaded an elderly Sufi cleric in the northern Sinai.

The exact reason for the attack on the mosque, called al-Rawda, remained unclear. That the attack occurred near the town of Bir al-Abd, an area dotted with security outposts, underscored the ability of militants to strike at the heart of government-protected zones.

The assault also had the hallmarks of a highly coordinated operation. More than two-dozen militants arrived at the mosque in several four-wheel-drive vehicles, according to officials and survivors. The attack started when one of the militants, a suicide bomber, detonated his explosives during the Friday sermon. The other militants — who fanned out around the mosque — gunned down panicked worshipers as they fled, according to Moemen Sharawy, whose relatives were at the mosque during the assault.  

Two of Sharawy's uncles were killed in the attack, including Fathy el-Tanany, 62, who led the call to prayer at the mosque, he said.

Several of the militants also entered the mosque and shot worshipers inside, according to Mohamed Elhor, a journalist who lives in Bir al-Abd and helped transport injured survivors to the hospital. Elhor said that four of his relatives were killed in the attack.

The mosque had been crowded with local residents as well as people displaced by violence in other parts of the northern Sinai, said Elhor, who added that he expected the death toll to rise. One hospital had a list of 300 fatalities, he said. But other bodies also were taken to hospitals miles away. After shuttling the wounded from the mosque, "my clothes were covered in blood," he said.

An injured survivor of the attack, interviewed by a local Sinai news outlet, said he saw between seven and 10 masked gunmen inside the mosque, wearing military uniforms and carrying the black flags favored by Islamic State militants. "They started shooting inside the mosque, and people started falling everywhere," said the man, who was not identified in the video.

Footage of the aftermath of the assault showed dozens of bodies, covered with blankets or bloodied sheets, in rows inside the mosque. Some of the injured were ferried away in cars and in the beds of pickup trucks. 

"Horrible and cowardly terrorist attack on innocent and defenseless worshipers in Egypt," President Trump wrote in a tweet. "The world cannot tolerate terrorism, we must defeat them militarily and discredit the extremist ideology that forms the basis of their existence!"

In a subsequent tweet, Trump tied the carnage to his administration's strict immigration policies. "We have to get TOUGHER AND SMARTER than ever before, and we will. Need the WALL, need the BAN! God bless the people of Egypt," he wrote. He called Sissi to offer his condolences Friday.

Egypt's insurgency gathered momentum after a military coup in 2013 that ousted Mohamed Morsi, the country's first democratically elected president and a leader of the Islamist Muslim Brotherhood. 

The militants have repeatedly mounted large-scale, complex attacks on security personnel. Since July 2013, at least 1,000 members of the security forces have been killed in attacks in Sinai, according to data compiled by the Tahrir Institute for Middle East Policy.

The northern Sinai, a stretch of the country neglected by successive Egyptian governments, remains one of the lingering strongholds for the Islamic State as the group's self-proclaimed caliphate in Syria and Iraq has all but collapsed under air and ground attacks.  

Even as the government has tightened its grip on Sinai and claimed to have killed thousands of suspected jihadists, the threat from the militants has grown. In the past year, Islamic State militants have killed hundreds of security officers while broadening their attacks on Christians, killing dozens in bomb attacks on churches in Cairo, Alexandria and other parts of Egypt. The rise of another militant group, called the Hasm Movement, which has targeted judges and security officials, has further challenged Sissi's government.

The bloodshed Friday raised the specter of further mass killings of civilians. 

It also highlighted fears for the safety for millions of adherents of Sufi Islam in Egypt, whose practices have made them a target of Sunni militants. Last year, Islamic State militants asserted responsibility for two beheadings near Arish, including the killing of the elderly Sufi cleric, Sulaiman Abu Haraz.  

The al-Rawda mosque, while closely associated with Sufis, was also linked to members of a Sinai tribe that had opposed the Islamic State militants, said Elhor, the local journalist.  

The attack on the mosque was unusual because the Islamic State militants "believe it's not religious to blast a house of God," he said. But the militants also considered it their religious duty to kill "the devious ones, like Sufis, because of their beliefs," he added.

Fahim reported from Istanbul. Brian Murphy in Washington contributed to this report.