The Trump administration on Friday lost another attempt to block states’ so-called sanctuary laws when a federal judge struck down conditions the U.S. Department of Justice placed on law enforcement grants.

In siding with attorneys for the city of San Francisco and the state, U.S. District Judge William Orrick III of California’s Northern District said federal mandates that local agencies cooperate with federal immigration officials to receive crime-fighting money violate separation of powers and congressional spending authority provisions in the Constitution.