They 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.
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 worshippers.
“Local people brought the wounded to hospital on their own cars and trucks,” he said.
Egypt’s presidency declared a three-day mourning period, as President Abdel-Fattah el-Sissi convened a high-level meeting of security officials.
President Sissi condemned the extremist attack on a mosque in the troubled Sinai Peninsula, calling it “criminal” and “cowardly” and expressing condolences to the victims and their families.
In a statement after the meeting, Mr Sissi said the attack “will not go unpunished” and that Egypt will persevere with its war on terrorism. The suffering of the victims was not in vain, he added, and will only “add to our insistence” to combat extremists. Addressing the nation later on television, he repeated his view that Egypt was fighting a battle for the rest of the world.
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 US, Russia, France and Britain condemning the violence.
President Donald Trump denounced what he called a “horrible and cowardly terrorist attack on innocent and defenseless worshippers in Egypt.”
“The world cannot tolerate terrorism” he said on Twitter, “we must defeat them militarily and discredit the extremist ideology that forms the basis of their existence!”
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.