Washington CNN  — 

A federal appeals court ruled against the Trump administration’s attempt to block a California law that limits cooperation between law enforcement and federal immigration authorities.

The 54-page ruling Thursday from the 9th US Circuit Court of Appeals is yet another blow to President Donald Trump who has railed against so-called sanctuary cities, a catch-all term used to describe jurisdictions that in some ways do not cooperate with federal immigration enforcement agencies

Last year, the Trump administration challenged parts of three “sanctuary” laws in California designed to protect undocumented immigrants from federal immigration officials.

The California laws do that in a variety of ways, including requiring that employers give workers a heads up about potential worksite inspections, limiting the cooperation between local law enforcement and immigration authorities, and imposing inspection requirements on immigrant detention facilities.

The three-judge panel also upheld parts of a law that authorizes the California attorney general to inspect facilities detaining immigrants and affirmed the district court’s ruling on requiring employers to notify workers of inspections.

In a 54-page ruling issued Thursday, the panel also unanimously agreed with a lower court’s ruling regarding the 2017 state law on limiting cooperation between law enforcement and federal immigration authorities, the most contentious of the three.

“SB 54 may well frustrate the federal government’s immigration enforcement efforts,” the court said. “However, whatever the wisdom of the underlying policy adopted by California, that frustration is permissible, because California has the right, pursuant to the anticommandeering rule, to refrain from assisting with federal efforts.”

The Justice Department declined to comment.

The Trump administration has repeatedly tried to crackdown on sanctuary cities, seeing them as an impediment to immigration enforcement. But federal courts have thrown a wrench in those plans.

Federal courts, for example, also largely blocked the administration from taking away funds on grounds that jurisdictions don’t cooperate with immigration authorities.

The President confirmed earlier this month that the administration was floating the possibility of using sanctuary cities as political retribution against Democrats by moving undocumented immigrants to those jurisdictions. Department of Homeland Security lawyers had killed the proposal earlier this year.