Gov. Andrew Cuomo is threatening to sue the federal Immigration and Customs Enforcement agency to stop its ongoing raids to detain illegal immigrants wanted for serious crimes like assault and rape. A staggering 80 percent of those apprehended in recent ICE raids in New York were either convicted criminals or charged with crimes. But Cuomo’s siding with criminals over their victims.

He’s playing politics. Faced with a challenge on his left flank from Cynthia Nixon, he’s desperate to prove his liberal bona fides. Public safety be damned.

The governor is parroting Democrats across the nation who claim ICE should be abolished because it’s breaking apart families and peaceful communities. The facts prove otherwise. Eighty-eight percent of the illegal immigrants arrested in recent Los Angeles ICE raids and 81 percent arrested throughout California, according to the latest ICE data, had criminal convictions.

These are bad guys. So when House Minority Leader Nancy Pelosi (D-Calif.) claims that “unjust and cruel” ICE raids “terrorize innocent immigrant families,” don’t buy it.

Cuomo’s making the same bogus claim. Last Thursday, the governor denounced an ICE raid on an Upstate farm looking for Marcial DeLeon-Aguilar, a three-time deportee convicted for felony aggravated assault. Cuomo complained that Aguilar’s children had to watch their father being pinned by officers to block his escape.

What about families victimized by violent illegals?

Since January 2016, at least 25 Long Island youths have been executed by the MS-13 gang of Central American illegals. Some of the victims were left so mutilated they could hardly be identified. MS-13 beats the youngsters with baseball bats, puts plastic bags over their heads to suffocate them and then slices off their noses, ears and lips with machetes. No one read these victims their constitutional rights.

ICE’s Operation Matador targets MS-13 gang members. Yet Cuomo seems angrier at the ICE agents than at the MS-13 butchers.

Laughably, Cuomo issued a “cease and desist” letter to ICE last week, ordering federal agents to touch base with local police before taking enforcement action. Cuomo doesn’t have a leg to stand on. Check the Supremacy Clause of the US Constitution: Uncle Sam doesn’t need Andrew Cuomo’s permission to enforce federal laws.

Why the surge in visible, violent sweeps? ICE is forced to conduct sweeps out in residential communities because New York’s sanctuary laws are preventing the agency from taking custody of criminal aliens before they’re released from jail, like the agency used to do. As ICE’s Deputy Director Thomas Homan points out, these sanctuary policies are needlessly exposing New Yorkers to violence.

Cuomo’s mimicking California Democrats, who are in open rebellion against federal law enforcement. In February, Oakland Mayor Libby Schaaf issued a public alert about a planned ICE raid in her city before it took place, tipping off hundreds of wanted criminals to scatter. US Attorney General Jeff Sessions said to Shaaf, “How dare you needlessly endanger the lives of law enforcement just to promote your radical open borders agenda?”

Political pandering is driving this agenda. An amazing 27 percent of California’s population are immigrants. Immigrants disproportionately favor big government. California hasn’t elected a statewide Republican since 2006. New York is moving in the same direction, with 23 percent of its population foreign-born and Democrats gaining increasing control of state government.

Cuomo and other Democrats have been resisting the federal crackdown on immigrant-related crime and calling for increased spending on after-school music and sports programs to provide an “alternative” to gang activity in immigrant communities. That’s nonsense. Brutes willing to torture and mutilate a human being with a machete will not be dissuaded by learning to play the flute.

President Trump calls them “animals” who have turned peaceful neighborhoods “into bloodstained killing fields.” He’s got the right plan: “We will find you. We will arrest you. We will jail you. And we will deport you.”

Betsy McCaughey is a senior fellow at the London Center for Policy Research.