SAN FRANCISCO (AP) — A federal judge in California on Thursday barred the Trump administration from denying or conditioning the use of federal funds to “sanctuary” jurisdictions.

U.S. Judge William Orrick said a preliminary injunction was appropriate because the executive orders were unconstitutional just as they were in 2017 when President Donald Trump announced a similar order. Orrick issued the injunction sought by San Francisco and more than a dozen other municipalities that sued over a pair of executive orders the Republican president issued targeting local municipalities that limit cooperation with federal immigration efforts.

Orrick, based in San Francisco, wrote that defendants are restrained and enjoined “from directly or indirectly taking any action to withhold, freeze, or condition federal funds” and the administration must provide written notice of his order to all federal departments and agencies by Monday.