The jihadis shoot their propaganda across the internet in search of the Western world’s frightened and dispossessed. On Twitter and Facebook, from YouTube to Google Play, the Islamic State militant group (ISIS) traffics in lies, bombarding Western Muslims seeking adventure, compatriots or an outlet for their religious fervor.

The message is stark, terrifying: Your countries hate you. They despise your beliefs. They seek to destroy your faith and convert you to theirs. Your safety, your obligation to true Muslims, is to join the camp of Islam, the caliphate, and take up arms against the infidels.

Since the horrors of 9/11, American presidents operating under the advice of the intelligence community’s counterterrorism experts have understood that countering this propaganda has been among the most essential parts of the fight against ISIS, Al-Qaeda and other murderous jihadi extremists. Through carefully selected language and—for the most part—considered policy, the United States has worked to expose the lies and convince young Muslims drawn by the propaganda toward hate that they are welcome and appreciated in America.

That era appears to be over. President Donald Trump, in office for less than two months, has gutted the strategy used by Republicans and Democrats alike—out of ignorance, hubris or both—sending a new message from the White House, one that reinforces the jihadi extremists’ propaganda and increases the likelihood that more Americans will die in attacks.

“If there was a scriptwriter for ISIS, he could not have written a better script than what is coming out of the White House,’’ said M. Ehsan Ahrari, an adjunct research professor with the Strategic Studies Institute at the Army War College. “Since President Trump came into office, he has been going out of his way to make statements and decisions that are hurting America’s cause.”

The intricacies of fighting against jihadi attacks are complex. They involve military, cultural, linguistic, pattern recognition, social media and counter-propaganda skills, and they cannot be learned in a few days or by watching cable television. What might seem logical to the uninformed horrifies the experts who have spent years, even decades, trying to learn what drives jihadi movements and how best to reduce the danger of attacks. Ideas formed based on uneducated surmises, particularly those by people with poor knowledge of Islam, can backfire horribly. American leaders would never have taken the country into war against the Nazis without a comprehensive analysis of Hitler, his fascist ideology and its role in German nationalism. But in a matter of weeks, Trump has shown a willingness to do just that: make reckless actions that sound like common sense and lead his supporters to cheer, while exposing America to a greater danger from attacks than it faced before he entered the Oval Office.

The problem stems from the White House’s inability or unwillingness to understand two principles that have formed the core of American strategy in countering the jihadi threat. First, American Muslims and governments in Muslim-majority countries are the most important allies in the U.S.’s fight against extremists. And second, the enemies of America’s enemies are America’s friends. This requires understanding that not all Muslims practice their faith in the same way. Just as Catholics and Protestants murdered each other over doctrinal disputes in the wake of the Reformation 500 years ago (scholars estimate at least 50 million Christians died), the violent wars between the primary sects of Islam—the Sunnis and the Shiites—continue to this day. The large-scale attacks in the U.S. and the wars in Afghanistan and Iraq have involved Sunni extremist sects, including the most prominent of the violent groups, who tend to be practitioners of a particularly harsh form of Sunni Islam known as Wahhabism.

Moreover, the radical Sunnis kill non-radicals. So because Muslims are essential to combating jihadi extremists, and because many Sunni Muslims are sickened by the violent militants, every administration until Trump’s has taken care not to alienate Muslim allies, based on the counterterrorism analysis of American intelligence agencies.

For instance, during his time in office, President George W. Bush steadfastly refused to say “radical Islamic terrorism,” although he would occasionally mention “radical Islam” as a perversion of the Muslim faith. President Barack Obama also would not use the phrase, and Republicans condemned him relentlessly for bowing to “political correctness” that led America to downplay the nature of the threat.

Why did the two men avoid that label? Because the CIA told them to. The major jihadi threats to the U.S.—first Al-Qaeda and then ISIS—have desperately tried to portray their campaign of violence as a battle between Islam and the Western nations purportedly trying to destroy it. Counterterrorism experts at organizations like the Rand Corp. have found that Muslims convinced that Islam is under attack are more likely to join in the cause of violent groups. Muslim clerics can condemn fundamentalists, but when non-Muslims do so, it feeds into the ISIS narrative and empowers the organization. The emotional reaction of Muslims who are torn about whether to fight against the West would be strong, as it would for evangelists if violent killers in the Ku Klux Klan were called radical Christian terrorists (and make no mistake, the KKK, just like the Christian Identity movement, has claimed they are inspired to commit violence by their religion).

On his first day of office, Trump tossed aside 16 years of advice from the CIA’s counterterrorism experts. After just over 1,000 words in his inaugural speech, Trump said “radical Islamic terrorism” would be eradicated from the earth. Conservative commentators cheered, relieved that our commander in chief was no longer hesitant to use words they believed Obama and others had avoided out of political correctness. But experts cringed, seeing the phraseology as ignorant bullying that, for a few seconds of nationalistic joy, raised the danger level.

Former U.S. President Barack Obama holds a roundtable with Muslim American community leaders at the Islamic Society of Baltimore mosque in Catonsville, Maryland on February 3, 2016. Jonathan Ernst/Reuters

No one has to spend hours in a mosque to understand the importance of avoiding the phrase and others like it; just look at recent interactions between the leaders of two of America’s strongest allies. On February 2, Angela Merkel, chancellor of Germany, stumbled by using the phrase “Islamist terror” while on a state visit to Turkey, a friend of America’s that has allowed the U.S. Air Force to use one its bases as a major staging area for bombing and surveillance missions against ISIS. Turkish President Recep Tayyip Erdogan reacted in fury at Merkel’s slip. “The term ‘Islamist terror’ seriously upsets us Muslims,’’ he said. “The term should not be used…. The word Islam means peace. Therefore, if we use a word that means peace alongside terror, that will upset members of that faith…. So please, let’s not use that term. So long as it is used, we have to stand up to it. If we stay silent, it means we accept it. Personally, as a Muslim, as a Muslim president, I can never accept this.”

As intelligence analysts explained to both Bush and Obama, harsh words linking extremist Islam to terrorism should come only from Muslims, which Merkel made clear she understood at a speech at the Munich Security Conference in February. “It is not Islam that is the source of terrorism but a falsely understood Islam," she said. “I expect from religious authorities of Islam to find strong language in order to delimitate peaceful Islam from terrorism committed in the name of Islam. We as non-Muslims cannot do this. It should be done by Islamic clergy and authorities."

Soon after Merkel spoke in Munich, Vice President Mike Pence delivered a speech to the same audience and ignored the warnings of Erdogan, the German chancellor and the CIA. Four times he said variations of the phrase “radical Islamic terrorism” and portrayed its practitioners as fighting a war on Western civilization. ISIS could not have asked for more. If such words can anger an ally as important as the Turkish president, what impact does it have on ordinary Muslims being bombarded with the ISIS message that they are in a fight to save Islam?

But that sort of language is nothing compared with one of the greatest bungles in years to undermine counterterrorism efforts: Trump’s travel ban. The executive order banned visitors from seven Muslim-majority countries: Iran, Iraq, Syria, Yemen, Libya, Sudan and Somalia. Under the order, people from those nations were forbidden to enter the U.S. for 90 days regardless of whether they had valid non-diplomatic visas. For refugees, the order was worse—none could be admitted for 120 days, while Syrian refugees were banned indefinitely. Meanwhile, U.S. officials proclaimed that Christian refugees should be given top consideration for admission.

While federal courts have since blocked the order, the images and stories of Muslim families being torn apart, of children being held in detention, of old women being blocked from boarding planes, have gone worldwide. From a counterterrorism perspective, whether the most horrific tales are true or not—and some, such as the one about a woman dying in an airport, are false—does not matter. The fact that untold numbers of Americans turned up at airports to protest is also irrelevant. The tales of disrespect and mistreatment have spread across social media and been the focus of commentary and anger in Muslim communities in America and abroad.

Almost immediately, Islamists filled pro-ISIS social media platforms with declarations that the predictions offered by leading extremists were coming true. Some postings cited the words of former Al-Qaeda in the Arabian Peninsula leader Anwar al-Awlaki, who said the “West would eventually turn against its Muslim citizens.” (An American drone strike killed al-Awlaki in 2011.) ISIS picked up the same theme years later in its magazine, Dabiq. “Muslims in the crusader countries will find themselves driven to abandon their homes…as the crusaders increase persecution against Muslims living in Western lands so as to force them into a tolerable sect of apostasy,” one article read.

Aside from reinforcing Islamist propaganda, Trump’s travel ban doesn’t make Americans any safer. And it signaled that the White House is acting not on expert knowledge but on mere suppositions more likely to be spouted by a group of buddies hanging out at a bar.

In defending the Trump ban, White House officials said militants have set up training camps in the countries they identified in the ban. True but also irrelevant. Muslims eager to join the fight against the West do not just go down the street to their friendly neighborhood militant-training camp. Think of the camps as being more like a Caribbean resort: People travel there, then head home. Citizens of those countries are less likely to spend time in those camps because it makes them easily identifiable to local anti-extremists law enforcement. (The largest segment of people killed by ISIS and other Islamist groups are Muslims; they have as much interest in fighting the militants as Western governments do.) Volunteers who attend the camps overwhelmingly head off to battle in the Middle East, not the U.S.

In reality, no immigrants from any of the seven nations on the list have killed an American in an attack. Little of the threat, as identified by the CIA as far back as the Bush administration, comes from jihadis traveling to the U.S.; instead, it emerges from the spread of their ideology—often known as bin Ladenism—using online propaganda, message boards and social media. The West is primarily fighting an ideology, not a religion or a group of people from somewhere else. Trump’s travel ban has helped that ideology spread. In words echoed by American intelligence officials unwilling to speak on the record, Javad Zarif, the foreign minister of Iran, one of the countries affected by Trump’s executive order, tweeted that the travel ban “will be recorded in history as a great gift to extremists and their supporters.” Iran is led by a Shiite government whose militia forces was described by former Secretary of State John Kerry as “helpful” in the United States and Arab allies fight against ISIS.

What Trump doesn’t seem to understand is that the nature of the jihadi threat to America has changed dramatically since 9/11, and he is fighting the last battle. Today, the primary danger comes not from overseas but from here in the U.S. Contrary to the public perception advanced by alarmist, ill-informed or dishonest politicians, ISIS as an organization is struggling after significant defeats on the battlefield. It has lost large amounts of territory, its ranks of foreign fighters from the United States—and other Western nations—has collapsed, and many of its sources of financing have dried up.

Meanwhile, homegrown radicalization is on the upswing as more Americans and legal residents buy into the propaganda of bin Ladenism. “Al-Qaeda and [ISIS] continue to target Muslim-American communities in our country to recruit and inspire individuals to commit acts of violence,’’ George Selim, then the director of the Office for Community Partnerships at the Department of Homeland Security, testified before a congressional committee last September. In early February, the House’s Homeland Security Committee, chaired by Republican Michael McCaul of Texas, issued a report called the “Terror Threat Snapshot.” The document states that “there has been an unprecedented spike in the homegrown terror threat, primarily driven by the rise of ISIS.”

Indian Muslims shout slogans during a protest against ISIS and the November 13, 2015 attacks in Paris, in the eastern Indian city of Bhubaneswar on November 20, 2015. Biswaranjan Rout/AP

Despite Trump’s false representations, the procedures put in place after 9/11 have made it extremely difficult for jihadi attackers to get into the U.S. In fact, all recent attacks in the U.S. were committed by citizens or legal residents. In the past year, according to the Homeland Security Committee’s report, there have been 39 homegrown jihadi criminal cases in 19 states.

The U.S. has already developed a series of strategies for rooting out domestic jihadi threats—that’s part of why there have been dozens of criminal cases and relatively few attacks. The key to this effort is Muslims themselves. They are the ones at the mosques, in the community, listening to the words of the peaceful—and the potentially violent among them. They have been law enforcement’s greatest asset in identifying the small number of dangerous people hidden among them. Fathers have turned in sons they feared had become radicalized, while students reported classmates who seemed to pose a growing danger.

“Well-informed families and communities are our best defense against terrorist ideologies, which represent the current threat from [ISIS’s] propaganda,’’ Selim testified in September. “Within this context, working with communities to prevent radicalization to violence has become imperative.”

This is the same message that virtually every expert has voiced since 9/11. “Embedded within these communities are the linguistic skills, information and cultural insights necessary to assist law enforcement in its efforts to identify suspicious behavior,’’ Deborah Ramirez, a law professor at Northeastern University, wrote in 2004. “In order to have access to these critical tools and information, law enforcement recognized the need to build bridges required for effective communication with these groups.” Indeed, a 2014 report by the Congressional Research Service found that community policing through the establishment of relationships between law enforcement and Muslims had seen success in an array of cities, including New York, Chicago, Boston and San Diego.

Muslims have also been important in countering the online propaganda of jihadis. When the extremist narrative espoused on social media and message boards goes unchallenged, recipients of those messages are confined to an information bubble. In 2015, the Department of Homeland Security established a program called Peer-to-Peer, or P2P, contests, a government-sponsored competition where university students design online campaigns to counter violent extremism online. The government then uses the ideas that show the most success and scales them up for use around the world.

In 2015, Facebook joined with the government in sponsoring these student teams, allowing for the number to increase last year to 100 groups around the world. The Department of Homeland Security has described the effort as “essential” in creating positive messages to counter violent Islamist propaganda. Now vast numbers of those students have been insulted; most likely, many have families that would have been barred from coming into the U.S. by Trump’s order.

Equally worrisome: The travel ban also damages America’s efforts to combat the militants overseas. Even with all of the money spent by the United States in foreign countries on counterterrorism efforts, the majority of the work is performed by local Muslims partnering with American military and intelligence personnel. American troops and counterterrorism specialists, for instance, are working directly with local forces in Iraq, Libya, Syria and Yemen. By allowing American fighters and intelligence advisers to assist them—as well as by having government-to-government cooperation—the Muslim combatants, politicians and informants opposing the radical jihadis are putting their lives at greater peril. Now, by issuing the travel ban, the Trump administration has sent them a message: that America believes all Muslims are the same.

“The success of each mission [fought in the Middle East by American troops and intelligence personnel] requires local capabilities and knowledge, and the foundation of these efforts is trust,’’ the Soufan Group, a private intelligence service, said in a report issued as word leaked of Trump’s plan for the travel ban. “The news that those paying the highest toll in supporting U.S. counterterrorism efforts would be summarily barred from entering the U.S. could only have destructive effects.”

Members of Free Syrian Army (FSA) escort civilians after their victory in the Syrian town of Al Bab after the town center was entirely freed from ISIS terrorists as part of Operation Euphrates Shield in Aleppo, Syria on February 23. Emin Sansar/Anadolu/Getty

The damage caused by the recklessness of the Trump administration’s policies are even more wide-ranging than they might appear. For example, Iran has its own propaganda narrative—which Trump has now reinforced by including the country in the travel ban—that the American government does not differentiate between Sunnis and Shiites. The point is reinforced by the fact that Iraq, Syria and Yemen also have large Shiite populations.

Until now, American presidents have carefully balanced interests between maintaining local partners in counterterrorism activities while working to frustrate Iran’s efforts to increase its influence in the region. The U.S. depends on the predominantly Shiite Iraqi government as its primary ally in fighting ISIS. Since the fall of Sunni dictator Saddam Hussein in Iraq, Iran has been trying to gain greater influence over its majority-Shiite brethren in that neighboring country. And already relations between the U.S. and its allies in the Iraqi government have soured. With the news of the travel ban, the Iraqis called for a reciprocal ban on Americans coming into their country. Meanwhile, Iraq’s Popular Mobilization Forces, a group of powerful Iran-sponsored militia groups, have called for all Americans to be expelled from the country too. Trump has reinforced both the Sunni narrative of ISIS and the Shiite narrative of Iran, setting back U.S. counterterrorism efforts by almost a decade, according to a former government official with direct ties to the U.S. intelligence community, who spoke on condition of anonymity.

Time is slipping away. With each day, America’s enemies spread untold numbers of messages, videos, posts and articles across the internet, trying to persuade ordinary Muslims that their families, their friends and their faith are under attack. Because of Trump’s failure to act on the advice of experts, this fantasy that Islam faces its own version of Pearl Harbor could inspire increasing numbers of Muslims to join in the extremists’ fight against the West.

Trump, like every president, is duty bound to protect the lives of all Americans. If he does not learn that the intelligence community and the military know more than he does about how to fight the militants and how to stop the spread of their poisonous ideology, the president of the United States will fail at his most sacred, fundamental task: protecting the lives of its citizens.