The Islamic State considers Sufis to be heretics and thus deserving Islam’s death penalty for those who deviate from the faith. This attack took place in a Sufi mosque.
“Prosecutor: Militant gunmen in Egypt mosque attack carried ‘Islamic State’ flag,” Reuters, November 25, 2017:
CAIRO – Militant gunmen who killed more than 300 people in an attack on a mosque in Egypt’s North Sinai on Friday were carrying an Islamic State flag and were between 25 to 30 in number, the public prosecutor’s office said in a statement on Saturday.
The gunmen, some wearing masks and military-style uniforms, surrounded the mosque blocking windows and a doorway and opened fire inside with automatic rifles, the statement citing their investigation and interviews with wounded survivors….