In Washington’s latest battle over undocumented immigration, a bill to punish so-called sanctuary cities has been blocked in the U.S. Senate.

Democrats banded together to prevent debate on Republican-sponsored legislation curtailing federal funds to hundreds of cities and counties that do not cooperate with U.S. authorities in identifying and handing over undocumented aliens for deportation.

“This vile legislation might as well be called ‘The Donald Trump Act,’ ” said Senate Democratic Leader Harry Reid, referring to the businessman and Republican presidential front-runner who labeled Mexican immigrants as drug-runners and rapists and pledged to halt unlawful entries into the United States.

“Like the disgusting, outrageous language championed by Donald Trump, this legislation paints all immigrants as criminals,” the Nevada Democrat added.

Backers of the bill say noncooperation between local and federal authorities on illegal immigration endangers public safety.

They point to an incident earlier this year in which a Mexican national shot and killed an American woman after being released from custody in San Francisco, despite a federal request for his detention. A convicted felon, Juan Francisco Lopez-Sanchez had been deported multiple times and repeatedly returned to the United States.

“San Francisco is a so-called sanctuary city that arbitrarily decides when it will cooperate with the federal government and when it won’t,” said Senate Majority Leader Mitch McConnell, a Kentucky Republican. “When felons enter our country illegally and repeatedly, is it fair to victims and families to not do what we can to stop them?”

Advocates sound off

Advocacy groups weighed in prior to Tuesday’s procedural vote.

The American Immigration Council described local sanctuary policies as beneficial, saying they “limit entanglement between local police and federal immigration authorities.”

AIC argued that communication and trust between immigrant communities and local jurisdictions would be undermined if police officers were viewed as de facto federal agents acting on the U.S. government’s behalf.

“These [sanctuary] policies make communities safer and increase communication between police and their residents without imposing any restrictions on federal law enforcement activities,” AIC said in a news release.

By contrast, NumbersUSA, which advocates stricter U.S. immigration enforcement, praised the Senate bill as “protecting communities from violent criminal aliens who should have been removed from the United States before they victimize more innocent people.”

“It is long past time for Congress to act in stopping wholly preventable crimes committed by criminal aliens,” NumbersUSA said in a statement.

For years, immigration has animated U.S. political campaigns, particularly among Republicans.

“The scandalously poor enforcement of our immigration laws is made much, much worse by the lawless actions of 340 sanctuary jurisdictions across the country,” said Republican Senator Ted Cruz of Texas, a presidential candidate.

“Although these jurisdictions are more than happy, eager even, to take federal taxpayer dollars, they go out of their way to obstruct and impede federal immigration enforcement,” he said.

“Not only are these sanctuary policies an affront to rule of law, they are extremely dangerous,” Cruz added.

“This is nothing more than an offensive anti-immigrant bill, another effort to demonize those who risked everything for a better life for themselves and their children,” countered Democratic Senator Robert Menendez of New Jersey. “This bill does nothing more than instigate fear and divide our nation.”