Senate Republicans announced new legislation Tuesday that would allow victims of illegal immigrant crimes to sue sanctuary cities for damages.

The bill, sponsored by Sen. Thom Tillis of North Carolina, would create a private right of action for the victims. And it would punish states or localities that try to hide behind sovereign immunity by withholding block grant money.

Mr. Tillis said the bill is a “direct response” to moves by North Carolina authorities to refuse to cooperate with federal immigration authorities.

In one instance the Mecklenburg County Sheriff’s Office released an illegal immigrant charged with trying to strangle a woman in a domestic violence incident.

The bill would for the first time define in law what a sanctuary city is. As it stands, the bill would deem jurisdictions that refuse to notify ICE of the impending release of deportations target, or who refuse to detain targets for pickup, as sanctuaries.

“If politicians want to prioritize reckless sanctuary policies over public safety, they should also be willing to provide just compensation for the victims,” Mr. Tillis said.

The bill won praise from fellow Republicans including Judiciary Chairman Lindsey Graham.

“There must be consequences for governments and entities that gamble with public safety, refuse to work with federal officials, and refuse to deal with felons here illegally,” he said.

Sanctuary cities have existed for years, but their number has soared under President Trump as local public officials and some law enforcement leaders seek ways to tweak the president and to cater to immigrant communities.

As sanctuaries have grown, so have the horror stories.

The most prominent was Kate Steinle, the 32-year-old woman who was killed by an illegal immigrant while walking the San Francisco waterfront with her father in 2015. The man who killed her had been repeatedly deported, and had been slated for another deportation, but San Francisco asked ICE to turn him over for a drug prosecution — then the city released him without prosecuting.

More recently two MS-13 gang members initially charged with attempted murder were released by Prince George’s County, Maryland, over the objections of ICE.

After their release they would earn new murder charges after authorities say they killed 14-year-old girl they feared was going to rat them out over a gang robbery.

One of the sanctuary-protected teens came to the U.S. in 2016 as an Unaccompanied Alien Child, while the other came as part of an illegal immigrant family in 2015 — then ignored a judge’s deportation order issued in 2017.