Amid a bipartisan backlash, President Trump has tried repeatedly to shift blame to Democrats for his own administration’s “zero-tolerance” immigration policy, which has resulted in more than 2,300 migrant children being taken from their families along the US–Mexico border. “The Democrats have to change their law – that’s their law,” Trump told reporters on Friday.

The president didn’t specify which law he was talking about. But the statute at the centre of his administration’s policy is the work of Republicans – with origins dating back all the way to World War I – albeit with substantial Democratic support along the way. Known originally as the “Undesirable Aliens Act,” the statute would not exist without support from, respectively, a eugenicist and a white supremacist.

The law in question was the foundation of a memo Attorney General Jeff Sessions issued in early April that laid out the administration’s new, zero-tolerance policy. In the memo, Sessions instructed federal prosecutors in the southwestern United States to file criminal charges against any adults caught entering the country illegally. His order stripped officials of discretion over whether to place migrant families seeking asylum into civil proceedings, which allow families to stay together. (Court rulings limit how long the government can detain migrants in civil proceedings. There’s also no guarantee they’ll return for future hearing dates once they’re let out, a phenomenon that has prompted the president’s complaints about “catch and release.”)

On Monday, ProPublica published audio recorded at a US Customs and Border Protection detention facility in which a Border Patrol agent mocks the wails of migrant children as young as four. Liberals and conservatives alike have condemned the policy, calling it “cruel,” an “atrocity,” and “inconsistent with our American values.”

Top Trump administration officials have held their ground. “We are enforcing the laws passed by Congress,” Secretary of Homeland Security Kirstjen Nielsen asserted Monday. Her message echoed one Sessions had delivered to law enforcement officers in Indiana last week. “If you violate the law, you subject yourself to prosecution,” he said.

The federal law they say they are enforcing makes it a crime for foreign citizens to cross (or attempt to cross) the border into the US anywhere other than an official port of entry. A first offense is a misdemeanor; a second unlawful entry is a felony.

War antecedents

The law’s ancestry dates back to World War I. Till that point, US immigration laws had tended to be all or nothing: either no limits at all – or blanket bans for certain groups, such as the Chinese Exclusion Act. Others were free to enter provided they weren’t “lunatics,” polygamists, prostitutes, “suffering from a loathsome or a dangerous contagious disease,” or so on.

The result was floods of immigrants: Between 1901 and 1910, for example, close to 9 million came to the US As that happened, anti-immigrant attitudes mounted, with mass influxes from parts of Europe associated in the popular imagination with a litany of social problems, like urban poverty and squalor.

In May 1918, after the US had entered World War I, Congress passed a statute called the Passport Act that gave the president the power to restrict the comings and goings of foreign citizens during wartime. A few months later, however, the war ended – and with it, the restrictions on border crossings.

Federal officials saw potential in the criminal provisions of the Passport Act – a maximum 20-year sentence – as a tool for deterring immigration. So prosecutors ignored the expiration of the law and continued to indict migrants under the Passport Act for unlawful entry into the US.

Anti-immigration sentiment continued to climb and the rhetoric of the era has resonance today. One anti-immigration group at the time claimed that immigrants tended to be “vicious and criminal” – the “bootleggers, gangsters, and racketeers of large cities.” The war, Columbia University historian Mae Ngai has written, “raised nationalism and anti-foreign sentiment to a high pitch.”

In response, Congress began clamping down. With the Immigration Act of 1924, it capped the flow at about 165,000 people a year, a small fraction of previous levels The statute’s quotas curtailed migration from southern and eastern Europe severely. Another 1924 law – the Oriental Exclusion Act – banned most immigration from Asia. At the same time, Congress made it easier to deport non-citizens for immigration violations.

In 1925, a federal appeals court put a halt to the practice of indicting migrants under the Passport Act outside wartime. But immigration officials liked what they’d seen, and by 1927, they were working on a replacement.

The origins

Two men spearheaded the effort that would lead Congress to criminalise unlawful entry into the United States. They were motivated by eugenics and white supremacy.

The first was James Davis, who was Secretary of Labour from 1921 to 1930. A Republican originally appointed by President Warren Harding, Davis was himself an immigrant from Wales who went by “Puddler Jim,” a reference to his job as a youthful worker in the steel mills of western Pennsylvania. At the time, the Department of Labor oversaw immigration, and Davis had grown disturbed by what he’d seen.

Davis was a committed eugenicist, and he believed principles of eugenics should guide immigration policy, according to The Bully Pulpit and the Melting Pot by the historian Hans Vought. It was necessary to draw a distinction, Davis had written in 1923, between “bad stock and good stock, weak blood and strong blood, sound heredity and sickly human stuff.”

In November 1927, Davis proposed a set of immigration reforms in the pages of The New York Times. Among his goals: “the definite lessening and possibly, in time, the complete checking of the degenerate and the bearer of degenerates.” One “phase of the immigration problem,” Davis wrote, was the “surreptitious entry of aliens” into the United States in numbers that “cannot even be approximately estimated.”

Deportation alone wasn’t enough to deter illegal immigration, Davis wrote. There was nothing disincentivising the migrant from turning around and trying again. “Endeavoring to stop this law violation” by deportation only, he wrote, “is like trying to prevent burglary with a penalty no severer than opening the front door of the burglarised residence, should the burglar be found within, escorting him to it, and saying ‘You have no right here; see that you don’t come in again.’”

An immigrant who enters the country unlawfully, he concluded, “should be treated as a law violator and punished effectively.”

To bring his vision to fruition, Davis teamed up with a senator from South Carolina. Coleman Livingston Blease, a Democrat, was “a proud and unreconstructed white supremacist,” UCLA history professor Kelly Lytle Hernández wrote in her 2017 book City of Inmates.

Migrants from Mexico were one group whose numbers the increasingly powerful nativist elements in Congress hadn’t managed to restrict. Mexican workers were key to the booming economy of the southwest. Regional employers, particularly in the agricultural sector, had successfully lobbied Congress to block any bill that would choke off their primary source of inexpensive labor. As a result, migration from Mexico soared, with many Mexicans making illegal border crossings to avoid the cost and inconvenience of customs stations.

Blease saw in Davis’s proposal for criminal penalties a way to advance his vision of a white America, and he believed it would bridge the gap between the nativists clamoring for quotas and southwestern congressmen resisting them. Large-scale farmers didn’t mind criminal penalties, Hernández writes, so long as the law was enforced once the harvest was over.

The legislation wasn’t without its opponents, as the UCLA law professor Ingrid Eagly documented in a 2010 study of immigration prosecutions. Groups like the American Civil Liberties Union opposed the bill. The ACLU felt it was unfair and unlikely to deter migration. An immigrant “may be quite ignorant of this law before he starts on his journey,” the group told Congress.

Coleman Livingston Blease. Photo credit: Harris & Ewing Collection (Library of Congress)/Wikimedia Commons [Licensed under Creative Commons]

Despite the ACLU’s objections, a Republican-controlled Congress passed Davis and Blease’s bill in 1929. A Republican president, Herbert Hoover, signed it into law.

The law made it a crime to enter the United States unlawfully and, in so doing, “created the criminalisation of the border,” Eagly said.

The statute was swiftly put to use. Between July 1929 and June 1930, according to a Department of Labour report, prosecutors brought more than 6,000 unlawful entry cases. “It is believed that it will prove an effective deterrent,” the report’s author wrote. (In his recent memo, Sessions made similar claims about the Trump administration’s zero-tolerance policy.)

Little impact

But the law didn’t reduce migration. By 1933, the Labour Department concluded that its rosy outlook had been wrong. The 1929 law “does not seem to have the deterrent effect expected,” noted a Labor Department report published that year.

It blamed budget limitations and judges wary of meting out serious sentences if a defendant was going to be deported anyway.

In the 1930s, the Great Depression achieved what prosecutions and deportations had not. Immigration plunged as the labor market in the United States dried up. Prosecutions for unlawful entry dropped to about 5,000 a year, according to a 2012 examination of the law by Doug Keller in the Loyola University Chicago Law Journal.

A shortage of labour during World War II prompted the US to reverse course and encourage migration of temporary workers from Mexico through what it called the Bracero program. (The word refers to manual laborers in Spanish.)

Despite the earlier lessons, federal prosecutors began to focus their attention on bringing unlawful entry cases against Mexican migrants to deter workers from going around the Bracero program. By 1951, there were 15,000 illegal entry and re-entry prosecutions a year.

At the same time, Congress was working to overhaul American immigration law. The effort was spearheaded by two Democrats: Sen. Patrick McCarran and Rep. Francis Walter. Both were staunch anti-Communists who saw immigration – particularly from Eastern Europe and Asia – as posing a risk that Soviet or Maoist agents would infiltrate the country.

Their law is best known for preserving a quota system that meant about 85% of immigration visas annually went to people from northern and western Europe. But it also made a crucial change in the unlawful entry law.

In a counterintuitive move, Congress decided to reduce the penalties for unlawful entry – to a maximum of six months in prison. (It also added a felony provision for any additional illegal entry convictions.)

The change wasn’t driven by compassion or a shift away from criminalising unlawful immigration. Rather, it anticipated the creation of federal magistrate courts that would handle the cases, according to Eagly, the UCLA law professor. A defendant facing a misdemeanor charge punishable by six months or less generally doesn’t have a right to a grand jury indictment or a jury trial. Once Congress established federal magistrate courts, prosecutors could bring criminal charges against far larger numbers of defendants.

A Democratic-controlled Congress passed the law in 1952, but it was vetoed by President Harry Truman. His veto message decried “carrying over into this year of 1952 the isolationist limitations of our 1924 law.” Congress was unmoved and overrode his veto. (In this sense, Trump is correct that Democrats bear some responsibility for the unlawful entry law that underlies his administration’s new immigration policy.)

The unlawful entry statute has remained largely unchanged since 1952. In 1968, however, Congress finally passed a law establishing federal magistrate courts, allowing for a major expansion of charges under the unlawful entry law. Without the need to go through the grand jury process or deal with potential jury trials, immigration prosecutions – almost all for unlawful entry – shot up, Eagly found in her 2010 study: from 2,536 cases nationwide in 1968 to 17,858 in 1974.

The trend culminated in programs like Operation Streamline during the George W Bush administration, in which magistrate judges along the border took simultaneous mass guilty pleas for unlawful entry. (An appeals court ended the practice in 2009.)

The use of the law hasn’t been a partisan matter. The number of such cases spiked to nearly 50,000 in the last year of the Bush administration, and it stayed in that range for most of the Obama administration, according to federal government data maintained by the Transactional Records Access Clearinghouse at Syracuse University. By 2016, the number had fallen to about 35,000 – still higher than all but the last year of the Bush administration.

But the number of unlawful entry cases fell, the Transactional Records Access Clearinghouse data shows, during Trump’s first year in office, to 27,000. (It had begun to rise again in recent months, however, even before Sessions announced the administration’s “zero-tolerance” policy.) Convictions for immigration crimes now account for more than half of all federal criminal convictions.

This article first appeared on ProPublica.