My jaw doesn't drop easily, but it dropped reading this editorial in Saturday's New York Times. Carlos Slim must really have been yelling down the phone at them.

The editorial manages to pack into 800 words every cliché, lie, and sleight of pen in the open-borders inventory. "In the shadows?"—check. Obama's mass deportations?—check. Dropping the word "illegal" when referring to illegal immigrants?—check. The dismissal of the Kathryn Steinle killing as "a horrific accident" is particularly toe-curling.

The comments—select "Readers' Picks"—are scathing. I'd pass comment myself, but the Times readers—New York Times readers!!—say it all.

Lawmakers in Washington and around the country are in an uproar over what they derisively call “sanctuary cities.” These are jurisdictions that limit cooperation with federal immigration enforcement, or try in other ways to protect unauthorized immigrants from unjust deportation.

The Senate is voting Tuesday on a bill from David Vitter of Louisiana to punish these cities by denying them federal law-enforcement funds. The House passed its version in July. North Carolina’s Legislature has passed a bill forbidding sanctuary policies. Lawmakers in Michigan and Texas are seeking similar laws.

These laws are a false fix for a concocted problem. They are based on the lie, now infecting the Republican presidential campaign, that all unauthorized immigrants are dangerous criminals who must be subdued by extraordinary means.

The laws are a class-action slander against an immigrant population that has been scapegoated for the crimes of a few, and left stranded by the failure of legislative reform that would open a path for them to live fully within the law. And because crackdowns on sanctuary cities seek to thwart sound law-enforcement policies and the integration of immigrants, they are an invitation to more crime and mayhem, not less.

This is not what the Republicans want you to believe. They have seized on the tragic death of a woman, Kathryn Steinle, shot in July on a San Francisco pier by an unauthorized Mexican immigrant, to denounce that city’s sanctuary policies and those of other cities. Donald Trump, who began his campaign by slandering Mexico as a nation of drug-toting rapists, used the accused, Juan Francisco Lopez-Sanchez, as exhibit A. Like a racist pied piper, Mr. Trump has gotten his party to fall in line behind him. Two of his rivals, the demagogic Ted Cruz and the former immigration moderate Marco Rubio, have signed on to the Vitter bill.

Mr. Lopez-Sanchez was a homeless man with drug convictions but no record of violent crime; the bullet he fired was found to have ricocheted off the pier, suggesting that he had not targeted anyone. The suggestion that it was a horrific accident could well be true. What is clearly false is the claim that he moved to San Francisco to take advantage of its sanctuary policies. He was sent there by federal officials to answer an old, minor drug charge, then released.

Republicans tend not to be moved by senseless gun violence. But here was a case they couldn’t resist. They have turned Mr. Lopez-Sanchez, absurdly, into a stand-in for 11 million unauthorized immigrants living in the United States.

For this case of collective guilt by association, President Obama and his first homeland security secretary, Janet Napolitano, share some blame. They were the ones who greatly expanded the deportation machinery in a program called Secure Communities, proudly broadcasting their efforts to deport “criminal aliens.” It was a tragically misguided attempt to gain, through extreme harshness, Republican support for immigration reform.

It failed. And Mr. Obama’s unprecedented deportations of more than two million people, many of them not criminals at all, are what made the sanctuary-city movement necessary in the first place.

The country needs more sanctuary cities. It needs them to underscore what should be a bright line between civil immigration enforcement, a federal responsibility, and the state and local criminal-justice systems.

It’s odd to see Republicans muddying that line. They tend to like it when states act like policy laboratories, filling the gaps where the federal government has failed — except when it comes to treating recent immigrants with common sense and decency. Then they love a monolithic enforcement state, one that commandeers local and state resources in a united push to get millions of people — including those with minor infractions or no criminal records at all — out of the country.

That is Mr. Trump’s policy. Any sanctuary-city crackdown should be called Trump’s Law, but with a hat tip to Mr. Obama, who was legitimizing the conflation of immigrants and criminals long before Mr. Trump weighed in. Long after both men leave the scene, that damage will still be with us.

The best hope for a return to sanity lies not in Washington but locally. More than 320 jurisdictions have policies, like California’s Trust Act, to disentangle themselves from the federal deportation dragnet. They recognize that communities are safer and crime is reduced when law-abiding immigrants don’t fear and shun the police, and when they have access to services like libraries and banks.

The answer to an immigrant population in the shadows is — as it has been throughout our history — integration and welcome instead of scapegoating and oppression. And leaving local law enforcement free to focus on catching criminals and protecting public safety.