By David Ovalle

Miami-Dade County _ faced with threats by President Donald Trump to cut off federal funding _ violated the U.S. Constitution when it agreed to jail people slated for deportation, a judge ruled on Friday.

The judge's ruling was a rebuke of Miami-Dade Mayor Carlos Gimenez's much-criticized decision to allow county jails to hold immigrants awaiting deportation by federal agents, a measure that has sparked protests and anger by many immigration advocates in South Florida.

Circuit Judge Milton Hirsch wrote that the policy violated the 10th Amendment, which limits the reach of the federal government over states.

"Of course we must protect our country from the problems associated with unregulated immigration," Hirsch wrote. "We must protect our country from a great many things; but from nothing so much as from the loss of our historic rights and liberties."

The immediate impact of the ruling was unclear. For one thing, the judge did not explicitly order Miami-Dade jailers to stop honoring requests by the federal government to hold people marked for deportation or suspected of violating immigration laws. Hirsch's ruling also could be delayed by more litigation.

The county immediately filed a notice of appeal with the Third District Court of Appeal.

"It is Miami-Dade County's position that immigration is a federal issue which should be handled in federal court," according to a mayor's spokesman.

Since 2013, Miami-Dade County had stopped honoring most requests by federal authorities to hold undocumented or deportable jail inmates, even though their sentences were up or their cases closed. County officials expressed concern because the feds were not reimbursing the cost of detaining.

But when Trump took office in January, he threatened to cut federal funding from so-called "sanctuary" cities that did not cooperate with federal immigration authorities; Miami-Dade's political leaders had long resisted labeling itself that.

"Miami is not, and has never been, a sanctuary city," Hirsch wrote. "But America is, and has always been, a sanctuary country."

Gimenez, citing concerns about losing federal money, ordered the county jail system to honor all requests by immigration authorities, a decision that contrasted with some big-city mayors who vowed to resist Trump's efforts.

"Coercion achieved by financial starvation is no less effective than coercion achieved at sword's point," Hirsch wrote.

Federal agents have up to 48 hours to pick up someone being held in a county jail.

The county's controversial policy was challenged by James Lacroix, a Haitian national who had been living legally in Miami under what is known as "temporary protected status," which was afforded to the island nation in 2010 after a series of natural disaster. But Lacroix, at some point, was ordered deported after he continued to rack up felony arrests for driving without a valid license.

Lacroix was jailed in late January. Two days after Gimenez changed his stance on the detentions, federal authorities filed an official request asking that Lacroix be held for them if his case were to conclude.

On Tuesday, Lacroix pleaded guilty to two felony cases of driving with a suspended license. His sentence: credit for the several weeks he spent in jail. But Lacroix was not released, spurring his lawyers to ask that Judge Hirsch review the legality of the county's Trump-friendly policy.

Federal agents went to the jail on Wednesday to pick up Lacroix, who spent 28 hours in Miami-Dade jail custody after his state sentence was officially up.

"Forty-eight hours is a long time. We don't hold people in this country for 48 hours while police do their investigation," Lacroix's attorney, Philip Reizenstein, told the judge during a hearing on Thursday. "Or 24 hours. Or one hour."

Miami-Dade Commissioner Sally Heyman, a lawyer and sponsor of legislation that backed Gimenez's detention policy, said, "I have not seen the Judge's order but I am pleased that these complex legal issues are being reviewed in courts of law."

Juan Cuba, chair of Miami-Dade's Democratic Party, said the ruling should send a signal to the county commission, which approved the policy in a 9-3 vote on Feb. 17. "The Mayor and the Gimenez Nine can ignore the community but they can't ignore the constitution and the courts," he said.

(Miami Herald Staff Writer Douglas Hanks contributed to this report.)

(c)2017 Miami Herald