The Know-Nothings wanted German and Irish immigrants to get out because they were allegedly subversive and diseased people who were stealing American jobs. White preachers and politicians of the 1820s urged freed blacks to move to West Africa, supposedly for their own good.

From that drive to encourage blacks to go back where they came from to waves of nativist attacks on Catholics, Jews, Asians and Hispanics in nearly every generation that followed, "go home" rhetoric is as American as immigration itself.

President Donald Trump's raw assertion of nativist language, in attacks Sunday and Monday on four Democratic congresswomen - all of them U.S. citizens, three of them native-born - is consistent not only with his long history of attacks on people he perceives as the other but also with the nation's oscillating attitudes toward immigration.

From Calvin Coolidge's warnings in the 1920s that the country was becoming "a dumping ground" and that "America must remain American" to the "America: Love it or leave it" rhetoric that surrounded Richard Nixon's presidency, the nation's leaders have struggled for two centuries with a central ambivalence about its core identity as a magnet for immigrants.

"They have to love our country," Trump said Monday, doubling down on his initial statement that the House members should "go back and help fix the totally broken and crime infested places from which they came." "These are people that hate our country. . . . They're free to leave if they want."

Trump's comments have been criticized as racist, nationalist, nativist and ignorant, even as some of his supporters have defended his statements as blunt but necessary assertions that new Americans have an obligation to support their adopted country.

There is hardly any ethnic or racial group in the country that hasn't been told to go back where it came from. In collections of voices from the Japanese American internment camps of the World War II era, in diaries of the earliest Italian and Irish immigrants, in Jewish novels and memoirs from the turn of the 20th century, the slur is a mainstay.

Sometimes, it is a reaction against political protests: "If you don't like it here, go back where you came from."

Sometimes, it is a reaction to foreign conflicts, a backlash against people whose ancestral home - Japan, Korea, Vietnam, Iraq, Afghanistan - has become a battleground for the U.S. military. Asian Americans targeted with such slurs could respond: "We are here because you were there," suggested Elaine Kim, an Asian American studies professor at the University of California at Berkeley.

" 'Love it or leave it' was not necessarily a form of racist exclusion," said Christian Appy, a historian at the University of Massachusetts, Amherst. "In the 1960s, it meant that wherever the flag stood, you had to support it. But it also had a racial component because Nixon was courting the white, middle-class people who had traditionally voted Democratic."

Rhetoric that angrily tells fellow Americans to "go home" can be racist, nationalist or both, Appy said. "They overlap and reinforce one another."

Most historians trace the origins of American anti-immigrant politics to the first big wave of newcomers to the country after the nation's birth.

"You can't live under the Trump administration and be a 19th-century historian and not think all the time about the Know-Nothing party," said Amy Greenberg, a history professor at Penn State University. In the 1840s, when the U.S. population was 17 million, about 100,000 immigrants were pouring into the country every day, mostly from Ireland and Germany. And most of the newcomers were Catholics, entering a nation that was almost entirely Protestant.

The resulting backlash took the form of a new political party, officially the American Party, better known by its nickname, the Know-Nothings. Its members spouted overtly anti-immigrant rhetoric, including calls for the new arrivals to be put on ships back to their homelands. In the early 1850s, the party won governorships, including ones in Maryland and Maine.

"The big cry was 'let's deport immigrants who are criminals,' " Greenberg said. "They were really wound up about which Bible to teach in the public schools," seeing Catholic texts as subverting the King James version.

Calls to send certain Americans back to their ancestral homes have often come when immigrants or former slaves fought the status quo, said Ibram Kendi, director of the Antiracist Research and Policy Center at American University.

"When people of color in particular have resisted American institutions or America in a profound or even radical way, the typical response by some has been, 'We're not changing, so you need to go back to your country,' " he said.

Starting in 1817, white preachers and politicians, including James Madison, created the American Colonization Society, which recruited freed slaves and other free blacks to move to West Africa. The society focused on buying and freeing slaves and paying their way to a colony in what would become Liberia. Many of the group's members opposed slavery, but some abolitionists came to see the society's work as an effort to send talented free black people out of the United States, thereby bolstering the institution of slavery.

"The paradox, of course, with respect to black people who are descendants of persons who were enslaved in the United States, is that you're telling people to go back to where they came from after you forcefully transported them here," said William Darity, a public policy professor at Duke University.

Through the generations, "go home" rhetoric has peaked during periods of heightened immigration, said Thomas Pettigrew, a social psychologist at the University of California, Santa Cruz who studies discrimination and immigration.

Yet it's also been during such times that public opinion has grown more accepting of the latest newcomers to the country.

"There are two facts about immigration that are true at the same time," Pettigrew said. "The more immigrants you have, the more they're seen as a potential threat, against 'my job' or 'my community.' But at the same time, the more immigrants you have, the more contact you have have with immigrants, and contact is the most effective way of reducing prejudice."

The Statue of Liberty's welcoming message to immigrants - Emma Lazarus' classic poem embracing "huddled masses yearning to breathe free, the wretched refuse of your teeming shore" - was written in 1883 and built into the nation's iconic symbol in 1903, as the country was absorbing its biggest wave of newcomers ever. And the message was posted even as the country was passing laws designed to exclude large numbers of unwanted immigrants.

Trump's surge to political viability came just after the Republican Party had embraced an "autopsy" - its study of the party's prospects after Barack Obama's two presidential victories that decided it needed to transform itself into a welcoming home for blacks, Latinos and Asian Americans.

But Trump combined his campaign slogans about putting America first and making America great again with what Pettigrew called his "unconcealed use of prejudice against outgroups ranging from 'dangerous' Muslims to Mexican 'rapists' " to build an image as a politician who would not take part in political correctness.

Trump developed his stable of rhetorical tools long before he entered politics. "Go back where you came from" was a mainstay of right-wing talk radio during its heyday, and Trump was an avid consumer of such shows starting in the 1970s.

"I'm sick and tired of these damn immigrants," J. Paul Emerson said in 1994 on San Francisco's KSFO, a station that thrived on what it called "hot talk." "They should all go back where they came from." Emerson suggested that California taxpayers "go out and shoot illegal immigrants who come across the border."

In New York, where Trump grew up, that kind of language was very much in and on the air when he was starting out in business. Trump was a big fan of Bob Grant, who hosted a top-rated New York talk show from 1970 to 2012. Grant often called welfare recipients "maggots" and black criminals "subhuman scum" and was once the subject of a New York magazine profile titled "Why He Hates Blacks."

Grant occasionally had guests on his show from the extreme nativist fringe, including William Pierce, whose National Alliance was for many years one of the country's most prominent neo-Nazi groups. Pierce would explain to Grant's audience, which included many of his fellow Italian Americans, as well as many Jews, Catholics and immigrants from around the world, why many of them should be sent packing.

In 2011, Grant joined Trump in fanning the flames of birtherism, the made-up notion that Obama was hiding a foreign birthplace. Grant began pushing for a longshot candidate for president, one who he believed would have the backbone to stand up even "when they contemplate being called racist, which to most white Americans is the kiss of death": Donald Trump.

- - -

The Washington Post's Eugene Scott contributed to this report.