Friday’s bloodthirsty attack on a mosque in Egypt’s Sinai Peninsula during noontime prayers was a crime against all humanity. It wasn’t “just” an attack on Muslims. It was an attack on all of us who believe in civilization, tolerance and decency. At least 235 peaceful worshippers died, with more than 100 wounded.

One is tempted to call it the work of beasts, but no creature in the animal kingdom behaves with such avid, calculated cruelty.

Yet, the attack can be explained — though the explanation only makes it worse.

Islamist fanatics struck with bombs and automatic weapons, slaughtering first the faithful, then first responders. The reversed ratio of dead to wounded (usually more are wounded than killed) tells us how potent the explosions were and how carefully the attack had been planned and executed.

And it was no coincidence that the al-Rawdah Mosque was frequented by Sufis, the mystical, tolerant strain of Islam that finds joy, rather than a slavemaster, in its deity. Sufism has been the spiritual home of poets, such as Rumi or Hafez Shirazi. Sufi orders embraced music and even dance as expressions of faith. Sufis venerate saints, and some of their beloved figures quite liked wine. Sufi orders differ, as do Christian denominations, but none threatens the world with terror these days.

The greatest sheiks of Sufism had more in common with Catholic mystics, such as St. John of the Cross, or Protestants like Emanuel Swedenborg, than with the punitive, barracks-discipline Wahhabism funded by Saudi Arabia and enforced by terrorists. If you crossed a Quaker with an Episcopalian, with a soundtrack of Catholic plainchant, you’d get something like a Sufi.

In Judaism, the closest equivalent would be the Hasidim and the transcendent warmth they discover in God. Sufism at its purest yields exaltation, not the executions beloved of terrorists.

Naturally, the Islamic State, al Qaeda and their offshoots hate all Sufis, regarding them as heretics and enemies of Islam. Sufis focus on the inner relationship to God. Islamist fanatics focus on outward behaviors. With various Sufi orders practicing from Turkey to India, Sufism remains true to the humane undercurrent of a troubled faith.

Not that Sufism has a perfect history. As with all creeds, it’s had its highs and lows, ages of glory and eras of backwardness. But Sufism provides a path as close as Islam has come to that longed-for Islamic reformation of which we’ve heard so much superficial talk.

Friday’s attack was probably the work of Ansar Bayt al-Maqdis, the terror organization in the Sinai that pledges loyalty to the Islamic State. We’ll see what claims of responsibility arise, but, meanwhile, there’s more bad news.

Also on Friday, 16 Egyptian police officers were reported killed in a shootout with Islamist militants on the other side of the country, toward the Libyan border. All of this — along with countless attacks on Egyptian Christians — should alert us to the imperiled state of the most-populous Middle Eastern nation (96 million), the keystone securing the Arab world.

Nor is relief in sight. With the destruction of the Islamic State caliphate straddling the Syrian-Iraqi border, Islamist terrorists are looking for new homes and new targets. We’ll see still more terror in fragile or disordered states, just as the terrorists will continue to attempt to strike the West. But, as always, most of their victims will be fellow Muslims.

Religious fanaticism — not just from today’s terrorists — has touched every inhabited continent. Every great faith has spun off fanatical movements at one time or another. And religious fanatics cannot tolerate the least divergence from their rules. (Beware the man who tells you that he knows what God wants.) From Europe’s wars of religion to today’s persecution of Rohingya Muslims by Buddhists (yes, Buddhists), we humans have done and do unforgivable things in the name of faith. But it’s been a long time since we’ve seen the imaginative, merciless cruelty of the sort pursued by today’s Islamist butchers.

The Friday-prayers atrocity in the Sinai was an attack on every faith, on each innocent believer. If we possess any moral decency, we’ll condemn the attack as wholeheartedly as we do the attacks on our own soil.

Ralph Peters is Fox News’ strategic analyst.