The U.S. Trump Administration declared last year that federal funds would be withheld from “sanctuary cities” refusing to comply with immigration policies.

A New York federal judge ruled Friday that the United States President Donald Trump’s administration cannot hold millions of dollars in federal law enforcement funds on the condition that states and cities cooperate with federal immigration authorities because it is unconstitutional.

U.S. District Judge Edgardo Ramos ordered the administration to award the funds without conditions to “sanctuary cities” that offer protection to undocumented residents, citing the tenth amendment that upholds states’ powers.

He is at least the fourth judge to rule against the administration, saying Friday that legal limits on executive authority were "a check on tyranny and the concentration of power."

Ramos’ ruling prevents the federal government from withholding any future funds from the Edward Byrne Memorial Justice Assistance Grants. He has also instructed the justice department to transfer funds withheld last year. His ruling marks a victory for six states that had sued the administration in July, including New York, Connecticut, Massachusetts, New Jersey, Virginia, and Washington.

New York City has also filed a separate lawsuit and is one of dozens of cities, including Chicago, Los Angeles, Philadelphia, and New Orleans, that have resisted deportation enforcement.

"Today's decision is a major win for New Yorkers' public safety," said New York Attorney General Barbara Underwood in a statement.

Federal judges in Pennsylvania, California, and Illinois have previously ruled against the policy. The 7th U.S. Circuit Court of Appeals has upheld the ruling from Illinois, finding that Congress, and not the administration, has the authority to decide how the funds are spent.

The six states that filed lawsuits received grants totaling US$25 million in the last fiscal year. They said they were given an Aug. 10 deadline to decide whether to accept the funds on those conditions.

Last year, the Trump administration announced that state and local governments must give federal immigration authorities access to their jails and advance notice of immigrants' release from custody in order to receive that funding.

As part of that policy, the Justice Department has sought to punish cities and other local jurisdictions that have joined a growing "sanctuary" movement aimed at shielding illegal immigrants from stepped-up deportation efforts.

Trump has made tougher immigration enforcement a centerpiece of his presidency, most recently with a reactionary asylum ban to the migrant exodus from Central America, who have traversed thousands of miles through harsh conditions in the hopes of reaching the U.S.