PARIS—Egypt has seen a lot of carnage at the hands of terrorists over the last quarter century, but never in that time has it seen anything quite so horrible as the scene that unfolded during prayers at a mosque in the northern Sinai on Friday.

In what military jargon calls a “complex attack,” at least one bomb was detonated, and as worshippers tried to flee, multiple guerrillas—perhaps dozens—caught them in a crossfire. As of Saturday morning, the death count had surpassed 300, including some 30 children.

No claim of responsibility has been made as yet, and tribal vendettas may have played a part, but on Saturday the Egyptian public prosecutor announced the gunmen were carrying ISIS flags. The worshippers reportedly were sufis, denounced as heretics by ISIS and other extremists. Many belonged to a tribe that is said to have supported military operations in the region. Some of those killed reportedly were Egyptian army conscripts. Many pertinent facts remain murky.

But U.S. President Donald Trump was quick to react. He always is when there’s a question of terrorism related to Muslims anywhere in the world (as opposed to white-guy gun collectors in the United States). And his first pronouncement was a reasonable statement—so reasonable it read like the work of an assistant rather than POTUS. He denounced the “horrible and cowardly terrorist attack on innocent and defenseless worshipers in Egypt,” which it certainly was. He said, “The world cannot tolerate terrorism, we must defeat them militarily and discredit the extremist ideology that forms the basis of their existence!” which would be good if we could.

But his next tweet, three hours later, was pure Trump—a truly ugly, sinister and self-interested non sequitur:

“Will be calling the President of Egypt in a short while to discuss the tragic terrorist attack, with so much loss of life. We have to get TOUGHER AND SMARTER than ever before, and we will. Need the WALL, need the BAN! God bless the people of Egypt.”

Nothing about an attack in northern Sinai suggests the need for a wall between the United States and Mexico. (Other Trump tweets suggest he’s desperate to get that project started again.) And all the victims at the Sinai mosque were Muslims—should they be on the list of those banned? As for that last sentence, well, yes, God bless the people of Egypt and God help them as long as Trump is messing around in their affairs.

The Middle East has long been a world of trouble that every so often troubles the world. There are resentments born of colonial history, hatreds rooted in tribal rivalries, riches attached to vast quantities of oil and gas. There are burgeoning populations of young people massively frustrated by their governments because jobs are short, and there is a vast surplus of men and women who claim the one God is their God, giving them the right to slaughter their enemies.

Prudent leaders in the United States and Europe have known to tread carefully in the Middle East. Rash ones have created disasters. The most notable example was the U.S.-led invasion of Iraq in 2003, when President George W. Bush toppled the tyrant Saddam Hussein with no clearly thought-out plan to replace him.

Trump may or may not have thought that Bush’s Iraq operation was foolish. He says he was against it, but that’s hard to know, since he claims whatever is convenient at any given moment, and nobody gave a damn in those days what Donald Trump thought about the Middle East.

But today we have to, and what we have seen of his policies is not encouraging. His desire to see order imposed has attracted him to those leaders in the region who present themselves as tough guys, and say they are fighting terror, whether they are successful or not.

In Egypt, Trump has gone all in with President Abdel Fattah al Sisi, who has ruled since ousting the democratically elected (but largely incompetent) President Mohamed Morsi and declaring the party that had won him the vote, the Muslim Brotherhood, a terrorist organization.

One of the ways Sisi rallied support among fellow officers for his 2013 coup was to say that terrorists had taken over the Sinai, and he would restore order there. But it’s been four years and counting, and the northern Sinai has never been more dangerous, especially for Sisi’s troops. Trump tweeted about the need to be “tougher and smarter,” but toughness has never been lacking, and “smarter” seems to be beyond the ability of Sisi or, for that matter, his boosters in Washington.

The northern Sinai has been the scene of mass arrests and torture for most of this century, and under a media blackout for years, as Mona Eltahawy pointed out in the New York Times, “yet none of this has worked.”

The Tahrir Institute for Middle East Policy reported in September that since July 2013, when Sisi seized power, “nearly a thousand security personnel have been killed in more than 1,700 terror attacks across Egypt’s restive Sinai Peninsula, with more than 200 security personnel killed this year alone. Wilayat Sinai—the most active terror group in Egypt—has claimed more than 800 attacks across the country since it pledged allegiance to the Islamic State in November 2014.”

“The attacks continue despite Egyptian security forces’ efforts to eradicate terrorism in the province,” says the well-reported account on the institute’s website. “According to numbers compiled from official statements from the Ministries of Interior and Defense, Egyptian security forces have killed more than 2,500 terror suspects in counter-terror operations in Sinai since 2013, with significantly higher unofficial numbers reported by the media.”

Trump’s very first trip abroad was to Saudi Arabia, where impetuous young Crown Prince Mohammed bin Salman, 32, claims he is reforming a sclerotic society, fighting corruption and restoring moderation to Islam—a dubious assertion Tom Friedman of the New York Times accepts as if it were a moral crusade instead of what it clearly is, a campaign to consolidate and solidify the dominance of one narrow branch of the Saudi royal family. Meanwhile the prince who had been the West’s key ally fighting terrorists, former Crown Prince Mohammed bin Nayef, was deposed and silenced.

The Trump administration’s desire to have “strongmen” impose order in the Middle East has even led it to tilt toward passive acquiescence to the reestablishment of control by President Bashar al Assad across Syria, now that the so-called Islamic State has been decimated there.

But Assad is not a strong man at all. He is a weak, murderous tyrant who formerly supported the core fighters of the Islamic State when they were killing Americans in Iraq, then set them loose in Syria after a popular uprising so he could portray his savagery as a fight against terrorism. He is only in power now because he is propped up by Russia, which is no friend of the United States (whatever Trump believes), and Iran, which Trump would have us think is the source of all evil in the region.

At the beginning of this century, just after al Qaeda’s attack on New York and Washington, American headlines asked, “Why do they hate us?” But that was the wrong question if one wanted to begin to understand the troubled relations between the U.S. and the Middle East. The core issue, really, was, “Why do they think we hate them?” If one wanted to “discredit the extremist ideology that forms the basis of their existence,” that should be the starting point.

In 2001, one might have searched for and found relatively complex answers explaining why Arabs and Muslims feel America hates them. Today, all one needs to do is read Donald Trump’s twitter feed.