PORTLAND, Ore. (AP) – A judge has barred the Trump administration from withholding public safety grants from the state and the city of Portland over Oregon’s sanctuary law that directs police not to help federal agents enforce immigration policies.

U.S. District Judge Michael J. McShane, who is based in Eugene, Oregon, also said in the decision issued late Wednesday that the federal government can’t impose immigration-related conditions on the grant awards.

The Oregonian/OregonLive reports McShane made the decision in a case brought by Gov. Kate Brown, Oregon Attorney General Ellen Rosenblum and the city against President Donald Trump and U.S. Attorney General William Barr.

He found that two federal statutes unconstitutionally ban local and state governments and agencies from enacting laws or policies that limit communication with federal officials about immigration or someone’s citizenship status.