– IS targeting of Sufis –
There was no immediate claim of responsibility for the bloodshed.
The Islamic State group’s Egypt branch has killed hundreds of policemen and soldiers, and also civilians accused of working with the authorities, in attacks in the north of the Sinai peninsula.
They have also targeted followers of the mystical Sufi branch of Sunni Islam as well as Christians.
The victims of Friday’s attack included civilians and conscripts praying at the mosque.
A tribal leader and head of a Bedouin militia that fights IS told AFP that the mosque is known as a place where Sufis gather.
The Islamic State group shares the puritan Salafi view that Sufis are heretics for seeking the intercession of saints.
The jihadists had previously kidnapped and beheaded an elderly Sufi leader, accusing him of practising magic which Islam forbids, and abducted Sufi practitioners later released after “repenting”.
An IS propaganda outlet had published an interview earlier with the commander of its “morality police” in Sinai who said their “first priority was to combat the manifestations of polytheism including Sufism”.
The group has killed more than 100 Christians in church bombings and shootings in Sinai and other parts of Egypt, forcing many to flee the peninsula.
The military has struggled to quell jihadists who pledged allegiance to IS in November 2014.
IS regularly conducts attacks against soldiers and policemen in the peninsula bordering Israel and the Gaza Strip, although the frequency and scale of such attacks has diminished over the past year.
The jihadists have since increasingly turned to civilian targets, attacking not only Christians and Sufis but also Bedouin Sinai inhabitants accused of working with the army.
The Gaza Strip’s border crossing with Egypt that had been due to reopen Saturday will remain closed until further notice because of the attack, a Palestinian official said.
Aside from IS, Egypt also faces a threat from Al-Qaeda-aligned jihadists who operate out of neighbouring Libya.
A group calling itself Ansar al-Islam — Supporters of Islam in Arabic — claimed an October ambush in Egypt’s Western Desert that killed at least 16 policemen.
Many of those killed belonged to the interior ministry’s secretive National Security Service.
The military later conducted air strikes on the attackers, killing their leader Emad al-Din Abdel Hamid, a most wanted jihadist who was a military officer before joining an Al-Qaeda-affiliated group in Libya’s militant stronghold of Derna.