SAN FRANCISCO (AP) -- A U.S. judge in California struck down an immigration law Friday that the Trump administration has used to go after cities and states that limit cooperation with immigration officials.
The ruling by Judge William Orrick also directed the U.S. Department of Justice to give California $28 million that was withheld over the state's immigration policies.
It was at least the third decision by a U.S. district court judge in recent months declaring the immigration law unconstitutional.
However, none of the three rulings immediately invalidated enforcement of the law nationwide. The law at issue forbids states and cities from blocking officials from reporting people's immigration status to U.S. authorities.
Orrick's ruling Friday in lawsuits by California and San Francisco may be the most significant yet because it applies to a major target of the administration's opposition to sanctuary jurisdictions. Orrick forbid Attorney General Jeff Sessions from enforcing the immigration law against California or any of its cities or counties.
DOJ spokesman Devin O'Malley declined comment.
The Trump administration says sanctuary cities and states allow dangerous criminals back on the street.
San Francisco and other sanctuary cities counter that turning local police into immigration officers erodes the trust needed to get people to report local crimes.
Orrick said the immigration law "undermines existing state and local policies and strips local policy makers of the power to decide for themselves whether to communicate with" immigration officials. It also shifts a portion of immigration enforcement costs onto states, he said.
"California expresses the legitimate concern that entanglement with federal immigration enforcement erodes the trust that Latino and undocumented immigrant communities have in local law enforcement," the judge said.
California Attorney General Xavier Becerra said the ruling was a victory.
"We will continue to stand up to the Trump administration's attempts to force our law enforcement into changing its policies and practices in ways that that would make us less safe," he said in a statement.
The administration cited the law in litigation filed against California in March that sought to block three state laws.
One of the laws prevents police from providing release dates and personal information of jail inmates -- information administration officials say they need to safely remove dangerous people who are in the country illegally.
U.S. Judge John Mendez in Sacramento has allowed California to continue enforcing that law.
California could use Orrick's ruling to ask Mendez to reject the administration's claim that the state is violating the 1996 law, said David Levine, an expert in federal court procedure at the University of California, Hastings College of the Law.
Sessions announced more than a year ago that cities and states could only receive Edward Byrne Memorial Justice Assistance grants if they allow federal immigration officials access to detention facilities and provide notice when someone in the country illegally is about to be released.
Orrick ruled Friday the U.S. Department of Justice could not require San Francisco and California to meet those requirements to obtain the Byrne grant.
"These unconstitutional grant conditions were yet another example of presidential overreach," San Francisco City Attorney Dennis Herrera said in a statement.