Imagine attending a performance of “Les Miserables” in which a third of the audience is rooting for Javert, the police inspector. Jean Valjean to the galleys! Valjean is, after all, an escaped convict and justice must be served. To temper it with mercy would undermine the law, whatever Valjean’s good works. Amnesty might establish a precedent and endanger the welfare of the state. What is at stake is not individual virtue but social cohesion. Remove a pillar of society for reasons of sentiment and the entire edifice collapses. Javert was right to pursue his quarry.

While most Americans who have seen the popular musical might take issue with this line of reasoning, there is a receptive audience for such a rationale, as the drama of deporting 800,000 Dreamers is played out on our national stage. These are young undocumented immigrants who came here as children and until now have been shielded by the Obama-era program known the Deferred Act for Childhood Arrivals, or DACA. Even President Trump, who has threatened to end the program, seems torn between tossing red meat to his base and throwing these deserving young people to the wolves.

Consequently, he has decided to punt and cast the issue into the lap of Congress, with the warning that if it does not resolve the issue within six months, he will rescind DACA. In doing so, he may have crossed a line, given polls showing widespread support for the program throughout the nation. The problem for Trump is that these young people who have grown up as Americans represent the very entrepreneurial impulses upon which he has lavished so much praise, as a model that we should strive for. To deport them would be perceived as an act of hypocrisy and cruelty, not to mention political miscalculation.

Nevertheless, the attorneys-general of 11 states have gone to court to challenge the Obama program on the grounds that it is unconstitutional. Half of them spring from the old Confederacy, most of the rest are from the Midwest. With the exception of Texas, none of the states with large immigrant populations is party to the case. Conservative ideologues, who long preached the gospel of states’ rights, have become nationalists, at least on immigration. If successful, the suit would lead to the deportation of technology workers in Silicon Valley, college students in New York, digital innovators in Boston, and US military veterans. Restrictionists claim that illegal immigrants take jobs from Americans. But economists demonstrate that Dreamers actually create jobs. Marc Zandi, chief economist at Moody Analytics, estimated that if DACA is rescinded, the US economy would be more than $100 billion poorer five years later. And a broad cross-section of American business leaders have also weighed in on the benefits of keeping such a productive cohort in the work force. So if the economic case is a straw man, one must wonder what is motivating the plaintiffs in pursuing the case. Why such diligence in upholding the laws of the land that takes them so far afield?

Their letter to US Attorney General Jeff Sessions demanding that the Trump Administration rescind the Obama program is couched in high-sounding legalese, citing a court ruling to justify their efforts to prevent what they perceive as an abuse of executive power. That this may lead to the expulsion of 800,000 young people who have grown up as Americans is of lesser consequence to these gentleman than that the letter of the law, as they see it, be upheld. That the Dreamers spring from alien cultures, whose growing numbers pose a threat to the political power of the attorneys-general, is never mentioned in the petition. Rather, it’s wrapped in legalisms that seek redress as a matter of principle.

Whatever their disclaimers, the plaintiffs are operating in a grand tradition. From Spain’s expulsion of the Jews in the 15th century to Germany’s Nuremberg laws in 1935, states have always used high-flown legal language to justify and, when permissible, camouflage racial policies. It was critical for the Nazis to couch their race laws in legalize. The Nuremburg Laws that deprived Jews of German citizenship and made race-mixing a crime were instruments of the state carefully constructed by German jurists and legal experts. Not all of them were Nazis, but all went along in making the Nazi racial program legal. At the time, these were not genocidal edicts, but once in place, they abetted the elimination that occurred under cover of war, seven years later. It was a policy that proceeded by increments: demonization, degradation, exclusion, expulsion and, when that failed, extermination.

One might well ask what these horrors have to do with our own situation. It turns out that in promulgating the Nuremberg Laws, the Nazis used US racial codes as a prototype for their own legislation. In his important recent book, “Hitler’s American Model,” James Whitman chronicles the influence of American racial statutes on the Nuremberg Laws, reducing blacks to second-class citizenship that predominated, but were not limited to, the American South in the decades before the Nazis rose to power. Nazi ideologues were desperate for legitimacy and America provided the most powerful precedent for their ambitions.

Whitman cites a conference of German jurists in the run-up to issuing the Nuremberg edicts in which the participants pored over American antecedents in enacting their Blood Laws. The Germans were particularly interested in US laws on miscegenation — racial interbreeding — which was illegal in 30 states, and criminal in many. In this, the US did them one better, since the Nazis were willing to draw the line at a single Jewish grandparent, whereas the Americans imposed a policy of “a single drop” of black blood.

The Nazis were also fascinated by the inventiveness of Americans in getting around their own Constitution, by creating state laws of vagrancy, literacy tests, poll taxes, grandfather voting clauses, and other such devices to hold blacks in legal subjection. They carefully studied American race law in terms of Chinese and Japanese exclusion and the marginalization of Filipinos and Puerto Ricans in the expanding American empire. True, the US was still a democracy and abided, at least nominally, by norms of tolerance and professed diversity. However, the Nazis were not looking to emulate, but rather to innovate from a set of racial ordinances that inspired their own burgeoning legal system. They boasted that what the Americans — handicapped by civil rights — accomplished with subterfuge, they would promulgate openly.

One area that most encouraged the Nazi lawmakers was the US Immigration Act of 1924, which imposed quotas that drastically reduced newcomers from Southern and Eastern Europe — most notably, severely curtailing Jewish immigration. They would apply these lessons in ethnic homogeneity to deport the Ostjuden — Jews from Eastern Europe who had flooded into Germany to escape the pogroms that erupted in the chaos following World War I. Unfortunately, from the Aryan point of view, the US had failed to undertake anti-Jewish measures, and was still committed to democratic norms, but the Nazis compensated for this error. Perhaps their greatest cheerleader in all of this was the Fuhrer himself, who, in making his case for Lebensraum in the East, cited the way the Americans had “gunned down the millions of Redskins” and kept the remnant “in a cage,” in conquering the West.  It should be noted, as Eric Weitz emphasizes in his “Weimar Germany,” that Hitler came to power not through a general election — his maximum vote was 37 percent of the electorate.  Rather, he was named chancellor through the machinations of respectable German conservatives, who thought they could control him and who collaborated in his early regime.

In addition to bridling at illegality, the other Restrictionist rationale for deporting Dreamers is resisting the temptation to make exceptions. Even such hard-liners as Rick Santorum profess sympathy for the Dreamers’ plight, but warn that if we exempt them the floodgates will open. The logic of this argument assumes that allowing Dreamers to abide here may prompt a horde of others to follow suit. Then again, it may not. We are in hypothetical land. The motivations of illegals to cross the border are varied. To assert that permitting Dreamers to remain would incite a rash of border-jumping is hypothetical.

There is a precedent for this as well: the expulsion of the Jews from Spain in 1492. While the Inquisition has been identified correctly with Jewish persecution, its targets in the Spanish lands were not the Iberian Jews, who were considered infidels, but the Conversos, Jews who had accepted baptism — many coerced, some expedient, a few sincere. The backsliders among these New Christians were deemed heretics, and it was they who were consigned to the rack and the stake. It was not the Church but the state that ordered the Jews to be banished from the realm. Queen Isabella’s rationale in issuing the edict was that the very presence of the faithful Jews might cause recidivism amongst their former brethren. Not that it did, but that it could. Based on her illusory prejudice that the remaining Jews might provide a source of temptation, they were expelled. The deportation of Spain’s Jews was not dissimilar in spirit to the imagined concerns of our own nativists in fearing the example the Dreamers might provide for others.

America’s first immigration law, enacted in 1791, opened its doors solely to whites. This was only two years after the Bill of Rights was ratified, and hardly more than 15 years after the Declaration of Independence that declared all men to be created equal and offered the promise of life, liberty and the pursuit of happiness. In the more than two centuries that followed, our nation has fought a struggle between aspiring to its own noblest ideals and succumbing to its darkest impulses. The conflict is unending. We are currently at the forefront of such a battle. The Dreamers are the testing ground. If the Nativists can drive them out, then the fate of the other nearly 11 million undocumented immigrants could well be sealed, unleashing a mass deportation unseen anywhere in modern times. Let us hope that in this contest, our better angels will prevail.

Jack Schwartz was formerly book editor of Newsday.