(Reuters) - A U.S. judge on Friday blocked the Trump Administration from placing conditions on public safety grants to further its crackdown on illegal immigration, and he ordered the grant money to be released to California “sanctuary cities.”

However, while Judge William Orrick in San Francisco found that the conditions placed last year on public safety grants by U.S. Attorney General Jeff Sessions were unconstitutional, he stayed a nationwide injunction pending appeal.

The U.S. Department of Justice declined to comment.

The grant conditions required recipients to provide Immigration and Customs Enforcement agents access to jails and prisons, provide notice when detainees were being released and certify that information was being shared with federal authorities.

California Attorney General Xavier Becerra sued the administration in August 2017. The state argued that putting the conditions on the $28 million in federal funds it expected would undermine law enforcement and deter police cooperation by immigrants, a major population in the state.

Scores of jurisdictions around the United States have adopted some form of “sanctuary city” policies, which generally prohibit cooperation with immigration officials. U.S. President Donald Trump had made a removing illegal immigrants a key campaign pledge and he often criticizes the sanctuary cities.

Chicago, Philadelphia and Los Angeles have successfully sued the Trump Administration over the conditions on the public safety funds, known as a Byrne Memorial Justice Assistance Grant, and those cases are pending appeal.

The use of nationwide injunctions by U.S. District Courts have been a major roadblock to numerous Trump policies, and the appeals in the sanctuary city cases may provide an avenue for the administration to curtail their use by lower courts.