The Ninth Circuit Court of Appeals has dealt a major blow to California’s attempt to ban private immigration detention facilities -- ruling that the liberal state’s 2019 law is unconstitutional.

A larger panel of the traditionally liberal-leaning court ruled against the law on Monday, having already ruled against it in a three-person panel last year. It found that the law violated the Supremacy Clause, which prohibits states from interfering with the operations of the federal government.

The law, signed by Gov. Gavin Newsom in 2019, would have phased out privately run immigration facilities that are contracted by Immigration and Customs Enforcement (ICE). The law came as California and Democratic states across the country were pushing back against the Trump administration over its handling of illegal immigration.

California is a self-described "sanctuary" state which limits state and local cooperation with ICE. The federal government relies almost exclusively on two privately owned facilities in California and would have been phased out by the law.

GOP SENATORS WANT INFO ON ILLEGAL MIGRANTS' DESTINATIONS AMID CONCERNS ‘SANCTUARY’ CITIES DRIVING SURGE

But, in a ruling by Obama appointee Judge Jacqueline H. Nguyen, the court said that California would breach the "core promise" of the Supremacy Clause.

"To comply with California law, ICE would have to cease its ongoing immigration detention operations in California and adopt an entirely new approach in the state," the ruling said.

California Attorney General Rob Bonta's office told Fox News Digigital that it was still reviewing the decision but was "deeply disappointed in the outcome."

"Assembly Bill 32 was enacted to protect the health and welfare of Californians and recognized the federal government's own documented concerns with for-profit, private prisons and detention facilities," his office said. "At the California Department of Justice, we'll continue to do our part to stand up for the dignities and rights of everyone in our state."

AS TEXAS SENDS THOUSANDS OF MIGRANTS TO SANCTUARY CITIES, LIBERAL MAYORS SCRAMBLE TO RESPOND

ICE agents immigration

June 2, 2022: ICE agents conduct an enforcement operation in the U.S. interior. ((Immigration and Customs Enforcement))

The move was welcomed by immigration hawks, who saw the ruling as a blow to those seeking to abolish immigration enforcement.

"Open borders politicians and activists have, for years, tried to abolish ICE by taking out the very government contractors who assist with detention operations," RJ Hauman, head of government relations at the Federation for American Immigration Reform (FAIR), told Fox News Digital. "We’ve seen these efforts deployed in many ways, especially in California, and their efforts were correctly ruled unconstitutional." 

"The Constitution is clear — a state may not interfere with federal immigration enforcement, something the notorious Ninth Circuit even agrees with," he said.

The ruling comes at a time when "sanctuary" policies are being fiercely debated across the country amid a raging border crisis -- which has led Republican governors to bus or fly migrants into "sanctuary" jurisdictions, including New York City and Washington D.C.

CLICK HERE TO GET THE FOX NEWS APP

A group of Republican senators last week requested information from the Department of Homeland Security about the destinations cited by illegal immigrants who are being processed and released into the U.S. – amid concerns that "sanctuary" cities are driving the crisis.

There have been more than 2.1 million migrant encounters at the southern border this fiscal year so far, with more than 200,000 migrant encounters in August alone.

The Associated Press contributed to this report.