Washington (AFP) - America's distinction as a nation of immigrants -- that bedrock of its national identity -- has helped fuel the outpouring of outrage over President Donald Trump's travel ban. But it's hardly the first time that its borders have slammed shut.
A look back in time reveals that the history of immigration in America has been far from clear-cut, with many swings and contradictory messages.
"On the one hand, taking pride of being a nation of immigrants," says July Greene of the University of Maryland. "But at the same time, a long and complex history of trying to figure out whom to allow in and whom to exclude."
Its story begins nearly 150 years ago, long before Trump unleashed the current storm by closing America's borders to refugees and travelers from seven predominantly Muslim countries.
The 1882 Chinese Exclusion Act marked a radical shift for a young nation that had until then largely opened its arms to "your tired, your poor, your huddled masses," in the words of the poet Emma Lazarus about the Statue of Liberty beckoning from New York Harbor.
"There was really no policy, anybody could come, you just had to show up," says Columbia University's Mae Ngai.
The first federal law excluding a specific group, the measure barred entry to all Chinese workers following racist incidents on the West Coast. It remained in place for decades until 1943.
"That was the product of the so-called manifest destiny philosophy," Ngai says, "according to which Americans claimed that the whole continent should belong to the Anglo-Saxons."
- Outcry over Asia -
The law shaped another major restriction between the two world wars.
The Immigration Act of 1924 set a limit for the first time on how many immigrants the United States could take in, setting quotas per country that strongly favored northern Europeans.
"It was not explicitly said, but the idea, inspired by eugenics and anti-Semitism, was to keep Jews and Italians out," Greene says.
By setting certain criteria to determine immigrants' eligibility to become citizens, the law also drastically hardened America's immigration stance, forbidding entry to all Asian travelers.
World War II opened a new thorny chapter that evokes the current controversy over Trump's executive order.
In 1939, the government barred entry to European Jews by warning they could be secretly working for Nazi Germany.
"There was a kind of hysteria about a threat of a fifth column," Greene says.
In June that year, president Franklin D. Roosevelt's administration turned away the St. Louis, a German ocean liner carrying some 900 Jews fleeing Nazi persecution. They were forced to return to Europe, where more than a quarter eventually died in death camps.
Justifying his immigration restrictions eighty years later, Trump has echoed the logic of the 1930s, warning of a risk that refugees could join sleeper cells supporting the Islamic State jihadist group.
- Scapegoat -
The second half of the 20th century saw more hardline chapters.
At the start of the Cold War, the 1950 Internal Security Act gave the US administration the power to turn back anyone who could potentially hurt national security, a move targeting communist sympathizers.
In 1965, the Immigration and Nationality Act ended the way quotas had previously been allocated based on national origins, race or ancestry.
However, setting similar limits for all countries caused its own problems, putting migrants from more populous states at a disadvantage.
"It doesn't make any sense to have the same quota for China and Belgium," Ngai says.
Several decades later in 1980, president Jimmy Carter barred entry to Iranian nationals in response to the hostage crisis at the US embassy in Tehran.
Iran is one of the seven countries targeted by Trump today.
Although the various restrictions punctuating US history were the product of particular events, they were all predicated on the need to defend national security.
"All of those restrictions have been associated with nationalist appeals and have always used the question of national security to designate scapegoats," Ngai says.
This time around, Trump's action -- a thinly veiled attempt at keeping more Muslims out of the country, critics say -- may have more than ever to do with the prerogatives of one man.
It's one way, Greene says, "of gearing up this country to think of itself as being in war when it is not."