Mourners in the West Bank town of Qalqilyah carry the coffin of Sondos al-Basha, a Palestinian woman who was killed in the June 28 Istanbul airport attack blamed on the Islamic State. (Jaafar Ashtiyeh/Agence France-Presse via Getty Images)

A STRING of horrific suicide bombings linked to the Islamic State, all in Muslim nations, underline a crucial truth that has been ignored by Donald Trump and many others in the West: Terrorist jihadism is above all a war within Islam. Muslims have been its first victims — and they are the only force that can bring about its definitive defeat.

Though it is losing territory and leaders in Iraq and Syria, the Islamic State has managed to mark the last days of the holy month of Ramadan with a formidable offensive. Successive attacks in Istanbul, Dhaka and Baghdad and in three cities of Saudi Arabia since June 28 killed at least 290 people and seriously injured hundreds more. In the cases of Istanbul and Saudi Arabia, there were no formal claims of responsibility. But the assaults bore all the hallmarks of the Islamic State, which has made clear that it regards all Muslims who do not share its extreme ideology as enemies.

The terrorists’ targets included places frequented by foreigners — the Istanbul airport, a cosmopolitan cafe in Dhaka, Bangladesh, and the U.S. consulate in Jiddah. But one bombing also targeted the mosque complex in the Saudi city of Medina, where the prophet Muhammad is buried — one of Islam’s holiest sites. It’s hard to imagine a more direct challenge to Saudi political and religious authorities, who have fought both the Islamic State and al-Qaeda and tried to curb the spread of their religious influence.

To be sure, the Saudi and Turkish regimes have been far from ideal allies of the United States. Turkish President Recep Tayyip Erdogan was slow to move against the flow of extremist recruits to the Islamic State through Turkey, while Saudi Arabia’s sponsorship of mosques and charities promoting its own fundamentalist ideology has been a toxic influence in both Islamic and Western countries. Both have grown less tolerant of domestic opposition, including liberals advocating for free expression and minorities — whether Kurd or Shiite — with legitimate grievances.

The events of the past week nevertheless ought to make it clear that Sunni Muslim governments face a mortal threat from the Islamic State — and consequently are critical allies in the fight against it. A policy that regards the two sides as indistinguishable — that, say, bans all Muslim entrants to the United States — could have the devastating effect of weakening the very forces that are, for now, the only alternative to the jihadists.

The past week has seen an alarming campaign of slaughter unleashed by the militants of the Islamic State, hitting targets in four different countries. (Jason Aldag,Ishaan Tharoor/The Washington Post)

Mr. Trump’s camp is suggesting that he would not ban all Muslims from U.S. entry, only those from “terror countries.” Would that not include Saudi Arabia, homeland of most of the Sept. 11, 2001, hijackers? Would a Trump administration retreat from U.S. commitments to defend the Persian Gulf states, or NATO member Turkey, as the candidate has suggested? If it did, how would it partner with the intelligence and counterterrorism officials in Riyadh now attempting to track down those who carried out the attack on Muhammad’s grave as well as the U.S. consulate? To consider those questions — which Mr. Trump has shown no sign of having done — is to understand how damaging his presidency could be to the anti- terrorism cause.