President Trump’s executive order to sharply restrict immigration from seven predominantly Muslim countries has been decried by many as reckless, punitive and even unconstitutional.Nearly half the electorate, however, applaud the president for suspending immigration even if it means turning back refugees, many of whom are innocent victims of the political violence besetting the Middle East.

None of this is unprecedented.

American presidents have periodically curtailed the entry of individuals or groups in the name of national security. Such measures invariably have proven controversial, often unleashing a fiery public debate about the relative merits of protecting the homeland at the cost of undermining our values.

As a historian who has studied how Central European Jewish refugees were denied entry to the United States during World War II, I know that while America has often welcomed immigrants to its shores, there have been moments in our past when our doors have slammed shut on those most in need.

Nor has there been a shortage of animus to those already in the country. Father Charles Coughlin, whose Sunday afternoon radio program boasted a nationwide audience of 30 to 40 million during the 1930s, spewed invective about how the Kristallnacht was justified by historic wrongs committed by Jews against Christians. Isolationists, America Firsters and pacifists condemned American Jews for warmongering.

Nazis in America?

Fort Missoula internment camp, Montana, 1943.

One such moment when the distrust of refugees reached a fever pitch occurred during the spring of 1940, when a succession of lightning-quick German victories in Western Europe led Franklin Roosevelt to raise the specter of Nazi infiltration into the Americas. The swift capitulation of Western Europe was attributed to Nazi agents, disguised as journalists, diplomats, tourists and refugees, in the months prior to the German invasion.

In his fireside chat of May 26, 1940, FDR implored the public to be vigilant of a Fifth Column threat: internal traitors, who would undermine the nation’s ability to defend itself. Here Roosevelt was alluding to more than 250,000 German- and Italian-Americans, some of whom were thought to be more sympathetic to their homelands than their adopted country.

Even though historians have offered correctives about the nature and extent of the Fifth Column’s role in the Nazi victories, the perception at the time among the Allied military establishment, the press and the public on both sides of the Atlantic was that such furtive activities were vital to the Reich’s war effort. Rumors and erroneous reports, some surreptitiously placed by British intelligence which sought to sway American public opinion of the need to enter the war, raised alarm about Nazi sabotage on the home front.

FDR warned Congress of Germans leapfrogging from North African bases to Brazil and then sending troops up the isthmus through Central America to Mexico. Isolationist sentiment fed xenophobia against imagined threats from radicals and foreigners. An obedient American public took the threat seriously. In just one day in May 1940, the FBI received more than 2,900 reports of suspected sabotage.

German advances persuaded Roosevelt and his advisers of the need to ensure greater control over aliens. By June 1940, Congress had passed the Smith Act, which required aliens to register and be fingerprinted and gave the government the power to deport current or past members of fascist and communist organizations. After Pearl Harbor, more than 11,000 German-Americans and 120,000 Japanese-Americans were rounded up and placed in internment camps for the duration of the war.

A curious logic

Roosevelt defended the need to watch refugees. He invoked an alleged Nazi threat to shoot family members of German Jewish refugees unless the latter consented to work for the Reich as spies. If enemies were believed to be living among the general population, it is perhaps understandable that refugees became such handy scapegoats. Each time a refugee in the U.S. was rumored to be a spy, whether corroborated or not, it lent credence to the restrictionist argument that excluding refugees was a matter of national security. Targets of discrimination in their homelands and in the United States, these stateless exiles experienced a kind of double jeopardy, victimized by a curious logic that gained greater resonance as it merged with Fifth Column paranoia.

In 1940, a State Department memorandum was sent to consular agents in Europe urging them to reject or suspend any application for a visa “about which there was any doubt.” From mid-1940 to mid-1941, only 4,000 refugees entered the U.S., down from 40,000 in the previous 12 months.

The department then went further, refusing to grant visas to individuals who had relatives residing in German-occupied territory. The problem, of course, was that by the middle of 1940 much of Central and Western Europe already was under Nazi control. Many were trapped, unable to get out.

The new regulations had the desired effect. Only 21,000 refugees were admitted from Axis-controlled nations for the war’s duration, a paltry 10 percent of the mandated quotas. If the new restrictive policies had not gone into effect and the quotas had been met, an additional 190,000 persons might have made it to safety to the United States.

Some within the State Department spoke out on behalf of the refugees, but to no avail. Robert Pell, the assistant chief of the Division of European Affairs, who manned the refugee desk, penned a feisty internal memourging aggressive action to spirit refugees out of Europe. From that point on, he was branded as an advocate for the exiles, and his position within the department became increasingly untenable.After Pell was reassigned, his successor, Charles Wagg, met a similar fate. His position at the refugee desk was “redefined,” and he was subsequently let go in the winter of 1941.

At first glance, the parallels between then and now are striking. Just as in 1940, we live in a moment when many are distrustful of foreigners and feeling economically insecure. In 1938, the unemployment rate was a staggering 19 percent and 10 million Americans were still unemployed. In contrast, the current unemployment rate has dipped to 4.8 percent, but that has not diminished the very real sense of economic dislocation that exists in our heartland.

In both cases, it was within the State Department that opposition surfaced. This time more than a thousand foreign service officers have expressed their disagreement in an internal dissent cable. During the Trump administration, however, consent has not been confined to the Foreign Service. The acting attorney general was summarily fired for refusing to comply with the executive order.

But we should be wary of facile comparisons. As brutal as Islamic State is, I’d argue it has never posed the existential threat to our way of life that Hitlerism did. Even though many wanted America to stay out of World War II, the country was not as polarized then as it is now. FDR, a popular two-term president about to win a historic third term later that fall, had earned the trust of many Americans. Public opposition to Trump’s executive order is much greater than it ever was to FDR’s restrictions. In fact, despite the looming humanitarian crisis in Europe in 1940, there was little sentiment to relax the quota restrictions and take in the refugees. Anti-Semitism, especially within the State Department, should not be discounted as well as a contributing factor.

War and economic uncertainty engender fear and stoke xenophobia. Roosevelt played upon those fears to help prepare the public for America’s entry in World War II.

In contrast, Trump has served as an echo chamber for the anxieties of his political base during the campaign and I’d contend now acts irresponsibly to fulfill his promises. The diplomatic consequences of this executive order are difficult to foresee. Sadly, history has provided ample evidence of the human costs.

Allen Wells, Professor of History, Director of Latin American Studies Program, Bowdoin College.

This article first appeared on The Conversation.