America, born with the aspiration of becoming “a city on a hill,” faces the serious danger of becoming a fortress, deluded in the belief that walls and airport detention rooms will offer security and prosperity. Through hard work, entrepreneurship, and complete allegiance to their adopted country, generations of immigrants helped create the most prosperous, powerful, and open society in human history. Throughout American history, but especially in the last two decades, immigrants have risen to the forefront of the country’s business, technology, science, and culture. But now the United States runs the risk not only of gravely damaging its competitive edge but also undermining its security by shutting its doors to a broad group of people whose cooperation America needs, both for economic growth and to win the war on terror.

America is one of several countries witnessing a new wave of rightwing, nativist populism, which claims to have the solutions for fighting Islamist extremism. But the notion that one form of prejudice can defeat another is an illusion. In reality, prejudice and brutality beget more of the same, feeding a vicious cycle. In the Islamic world, radical extremists have long claimed that only they offer an alternative to what they perceive to be the challenges of globalization and American hegemony. President Trump’s order last Friday, temporarily banning the citizens of seven predominantly Muslim countries from entering the United States, is arguably the most potentially consequential of such fallacious thinking. The problem with the new administration’s ill-advised policies and pronouncements is that they are not only heartless, cruel, and hostile to the spirit of what makes America great, but they are also clumsy, impulsive, and counterproductive.

The stated goal of president’s executive order is to defeat radical Islamists. In fact, the incompetent text of the order and the ethnocentric texture of the narrative that has accompanied it are bound to fail at achieving this objective for several reasons. The order undermines America’s ties to the very governments and individuals whose help is needed to defeat terrorist groups like ISIS. How will the United States defeat ISIS in Mosul without Iraqis at its side? How will it defeat ISIS in Raqqa without Syrians? The decree—and Trump’s later denouncing of a deal Obama had struck to take in some refugees who had fled to Australia—also has alienated America’s closest allies. Virtually every European ally of the U.S. distanced itself from the order—France, for example, not only criticized it, but defiantly doubled its quota of annual visas to Iranians—while right-wing nationalists in France gleefully claimed that more policies like Trump’s are needed. In other countries with majority or large minority Muslim populations, government and civil-society leaders have lamented Trump’s draconian decision. Even Israel has had dual citizens from the countries named in the order.

The ban not only weakens moderates in the Muslim world, but also gives a huge propaganda victory to radical Islamists, whether in ISIS or the Iranian regime, who can now more credibly claim that the United States is at war with Islam itself. In the wake of last Friday’s announcement, friendly governments in several Muslim countries explicitly warned of this rising danger. A central tenet of radical Islamists has long been that the predominantly Christian West can never be a safe harbor for Muslims. In this view, only an Islamist regime governed by sharia law can offer succor and safety for Muslims. Democracy, too, they say, is a trick of Western “Crusaders,” used only if is beneficial to rich and powerful Christians. Eliminating these “illusions” about the West, Islamists say, is critical to the victory of Islamism in the world. It will certainly aid hardliners in Iran, where, over the last four months, Ayatollah Ali Khamenei and his allies have incessantly attacked pragmatists like President Hassan Rouhani for trusting the United States.

In fact, the list of countries whose predominantly innocent citizens are temporarily banned from coming to the United States is both politically and practically flawed, and unlikely to protect America. The countries listed in the ban have not produced a single terrorist attack on American soil. Saudis and Egyptians attacked America on September 11th, but these countries are not on the list. An American and his Pakistani-born wife carried out the San Bernardino terrorist attack, but Pakistan is not on the list. The Tsarnaev brothers who terrorized Boston were Chechens—one was an American citizen, the other a Russian citizen.  Russia also is not part of the ban. Moreover, the Iranian and Syrian regimes are U.S. government-designated state sponsors of terrorism, but most of their victims and hostages have been their own citizens. Punishing those citizens for the sins of their despotic regimes is immoral and counterproductive.

In addition to not helping the global fight with terrorism, Trump’s decree also damaged American economic and scientific interests. Dozens of companies, including many high-tech firms, had their employees detained. Won’t some of them be tempted to move to friendlier places, including America’s neighbor to the north? Likewise, students were handcuffed and held, while others remain in their home countries wondering when they can return to their universities, including to our own university, Stanford. How does discouraging the best and the brightest in the world to study at American universities serve the country’s national interest?   The list of immigrants and refugees who came to the United States to escape repression and then thrive economically is too long to print. Remember just one: Sergey Brin—refugee, former Stanford student, co-founder of Google—who made a point of protesting at the San Francisco airport to show solidarity for those just like him, trapped on the other side of the border.

Only an America that is open, free, and true to its values can summon the understanding, forge the alliances, and win the broad cooperation necessary to defeat radical Islamist extremism. Only an America that welcomes immigrants and refugees will continue to innovate and prosper.