AS THE Trump administration fought in court to revive its temporary ban on entry by refugees as well as travelers from seven majority-Muslim countries, the president persisted in perversely suggesting that the judicial branch will be responsible for any terrorist attack carried out by what he portrayed as the violent hordes clamoring to enter the country.

By conflating a dangerous fiction about immigrants with blatant disrespect for an equal branch of government, President Trump fans the xenophobic flames he did so much to ignite during the presidential campaign. “Just cannot believe a judge would put our country in such peril,” he tweeted over the weekend, after a ruling by U.S. District Judge James L. Robart in Seattle, who was nominated to the court by President George W. Bush. “If something happens blame him and court system. People pouring in. Bad!”

The president’s calumny and travel ban have been denounced by an array of diplomatic and national security experts, not least former secretaries of state John F. Kerry and Madeleine Albright, who made the point, in a court filing, that the order would endanger U.S. troops and boost the Islamic State’s recruitment efforts.

Amid the furor, it is critical to remember that in recent decades the United States has admitted hundreds of thousands of refugees from the former Soviet Union, Yugoslavia, Vietnam, Iraq, Burma and elsewhere — never with ironclad assurances that those immigrants would love America or its values, though in many cases they clearly did.

Mr. Trump and his chief strategist, Stephen K. Bannon, pledge “extreme vetting” of new immigrants, especially refugees, which would somehow assure their patriotism and adherence to U.S. law as a condition of admission to this country.

It makes sense to scrutinize immigrants, particularly those from terrorism-prone regions, which is exactly what the current rigorous process does by subjecting applicants to multiple security, biometric, document and data checks by an alphabet soup of U.S. agencies. For refugees, the screening is painstaking, often lasting up to two years and involving face-to-face interviews in which factual discrepancies can mean rejection. Even tighter screening may be possible, particularly of social media accounts, although aliases, multiple languages and sarcasm could be pitfalls.

Even if the courts uphold its actions, it is critical that the administration not use the inevitable imperfections of any vetting process as a pretext to ban refugees for more than the 120-day period covered by the Jan. 27 order. Already, Mr. Trump has slashed the current fiscal-year target for refu­gee admissions to 50,000, from 110,000.

That’s a trickle when measured against the United States’ traditional role as a beacon to those fleeing violence and tyranny, and against global demand. The United Nations counts some 16 million refugees (excluding Palestinians); more than half are children . By far the largest number, nearly 5 million , are Syrians, who are barred indefinitely under Mr. Trump’s order.

“These are not Jeffersonian democrats,” sneered Mr. Bannon, referring to Muslim immigrants who entered Europe. In 2015, he asked, “Why even let ’em in?”

Similar remarks were made a century ago about immigrants from Ireland, Italy, Germany and Eastern Europe, then widely seen as unschooled, unwashed and, often, violent. No one would ask now, “Why did we even let ’em in?”