Florida Republican Gov. Ron DeSantis signed a controversial measure on Friday that blocks localities from becoming sanctuary cities and mandates they cooperate with federal immigration enforcement.

“I am proud to sign the bill presented to me by the Florida Legislature to uphold the rule of law and ensure that no city or county jurisdiction can get in the way of Florida’s cooperation with our federal partners to enforce immigration law," DeSantis said in a statement on Friday.

"This is about public safety, not about politics. We must do everything within our power, and use all the tools available to us, to ensure that our communities are safe.”

The bill targeted Immigration and Customs Enforcement (ICE) detainers -- requests by the federal agency for local and state governments not to release immigrants suspected of criminal offenses. States and localities across the nation have ignored these, prompting fierce criticism from the president and earning them the title of "sanctuary jurisdictions."

FORMER ICE CHIEF THOMAS HOMAN RETURNING TO ADMINISTRATION AS BORDER CZAR, TRUMP REVEALS

The bill narrowly passed the state's Senate (22-18 vote) and made it through the House with more than a 20-vote margin. “This bill isn’t anti-immigrant and it’s dangerously disingenuous to suggest otherwise," Rep. Elizabeth Fetterhoff, R-DeLand, reportedly said.

But groups like the Southern Poverty Law Center opposed the law, with Scott McCoy, the group's senior policy counsel, reportedly accusing DeSantis of using "racial grievance to drive a wedge between Floridians."

IMMIGRATION RIGHTS GROUPS ASK SUPREME COURT TO DELAY DECISION ON 2020 CENSUS

“It undermines public safety making our towns and cities less safe by requiring local law enforcement to spend less of their time and resources fighting crime in local communities and more on doing the work of federal immigration authorities," McCoy said.

The new law will likely face legal challenges as well, attracting more attention to an issue President Trump has brought to the fore by, among other things, harping on the tragic death of Kate Steinle. The American Civil Liberties Union (ACLU), which issued a travel advisory in response to the law, blasted the measure as "unconstitutional."

"The law is anti-immigrant, unconstitutional, inhumane, and hurts our families and communities," the ACLU of Florida said on Twitter.

Should the ACLU and others sue, it would serve up another potential case for the nation's courts to look at on this issue. Under former Attorney General Jeff Sessions, the Justice Department faced a legal battle after it cut off federal grants to cities that refused to cooperate with immigration enforcement. It also sued the state of California in 2018 over its sanctuary policies.

CLICK HERE TO GET THE FOX NEWS APP

Florida's law came as President Trump's administration struggled to meet the demands of a growing migrant crisis in which authorities ran out of time and space for housing illegal immigrants. Trump previously suggested that he would send illegal immigrants to sanctuary cities, allegedly including two South Florida counties -- Broward and Palm Beach. The administration later denied it had plans at the time to transfer migrants to those counties.