(CNN)They started swarming across America's border, millions of desperate families fleeing poverty or seeking political asylum.
When Americans tried to breed a better race: How a genetic fitness 'crusade' marches on
But many people were repelled by their presence. Some warned that the country was facing a "genetic invasion" and that whites were "losing the demographic game." Another said, "There will no longer be an America for Americans."
One leader even thought of a radical way to keep them out.
"Can we build a wall high enough around this country so as to keep out these cheaper races?" he asked.
That scenario may sound familiar, but it's actually a description of early 20th century America. The country was gripped by a demographic panic. That fear, along with mounting anxieties about crime and poverty, led to one of the most shameful episodes in American history.
"The Eugenics Crusade," an American Experience film that premiered on PBS Tuesday night, recounts how America responded to those fears. The country's leaders tried to breed a better race, and millions of American citizens were enthusiastic backers.
It was an ugly time. The eugenics mania that swept the country in the late 19th and early 20th centuries led to forced sterilizations and the passage of laws in 27 states designed to limit the numbers of those considered genetically unfit: immigrants, Jews, African-Americans, the mentally ill and those deemed "morally delinquent."
The engrossing two-hour film, though, is about something deeper than science. It is about fear -- how fear of "the other" can corrupt even the most brilliant minds. The film shows how an iconic inventor, a Nobel physics laureate and a brilliant Supreme Court justice all embraced the pseudoscience.
The crusade also found champions in social reformers like birth control proponent Margaret Sanger and W.E.B. DuBois, one of the founders of the NAACP. DuBois saw no irony in calling for African-Americans to "breed for better brains, for efficiency, for beauty."
The film, written and directed by Michelle Ferrari, is filled with jaw-dropping moments: newsreel footage of white American families merrily competing in "genetic fitness" contests at state fairs where they were measured like livestock; a retelling of a pivotal court case where a teenage mother was forcibly sterilized by her mother; and the story of how the irrepressible inventor of Kellogg's Corn Flakes became a champion of eugenics.
One the most chilling parts of the film, which is available online, involves an appearance by Adolf Hitler. Ferrari shows how America's sterilization policies inspired Nazi Germany's leaders to launch their own eugenics program, which later led to genocide.
Hitler actually wrote a fan letter to one of the biggest backers of eugenics in America, a wealthy lawyer named Madison Grant, who wrote a book, "The Passing of a Great Race."
"Your book was my bible," Hitler told Grant.
Few people today, however, know about this period in American history.
"It's like this dirty secret that people whisper to each other once in a while," says Nathaniel Comfort, a professor at Johns Hopkins University in Baltimore who is featured in the film.
"It's uncomfortable. It's ugly," Comfort says. "It's a nasty part of our country's history that's not very fun to confront. It's not very pretty to think about ways in which Nazi eugenics policies were practically modeled on American eugenics policies."
Behind every movement there's a powerful personality. The eugenics crusade had Charles Davenport, a slender, Ivy League-educated scientist whose dignified demeanor exuded an air of authority. The PBS film shows why Davenport was the right man to spread the wrong idea.
He was ambitious, a shrewd manipul