An appellate court recently ruled that California’s state law banning private prisons—including immigration detention centers—is likely unconstitutional. The decision is a significant blow to advocates fighting to end immigration detention in California and nationwide.

In its September 26 decision, the Court of Appeals for the Ninth Circuit ruled that the law in question, AB 32, is unconstitutional because it violates the Supremacy Clause. The court found that AB 32 intrudes on the federal government’s ability to make decisions about immigration detention.

California Governor Gavin Newsom signed AB 32 into law in 2019. His goal was to phase out private prisons in the state, including immigration detention centers. The law prohibits the state government and U.S. Immigration and Customs Enforcement (ICE) from creating, modifying, or renewing prison contracts with private companies. Other states have also taken steps to limit immigration detention in the last few years. But AB 32 was the most sweeping of these efforts, ordering the complete elimination of California’s private prisons by 2028.

ICE relies almost exclusively on for-profit, private prison companies like GEO Group and CoreCivic to detain people in California and around the country. Advocates and the Department of Homeland Security’s own Office of Inspector General have decried the inhumane conditions and abuses that run rampant in the private detention facilities ICE contracts with.

Despite President Biden’s campaign promise to end for-profit immigration detention, the Justice Department vigorously opposed California’s attempt to end immigration detention. The department continued to litigate the case against AB 32, GEO Group v. Newsom, after Biden came to office.

The lawsuit was brought by the Justice Department and GEO Group, one of the largest private prison companies in the country. Last year, a three-judge panel of Ninth Circuit judges heard the case and made a similar finding on AB 32. The state of California requested rehearing before the full panel of Ninth Circuit judges.

In its latest ruling, a divided Ninth Circuit again found that AB 32 likely violates the Supremacy Clause of the Constitution, which prevents states from interfering with the federal government’s operations. California argued that the federal government could comply with AB 32 by choosing to stop detaining immigrants within the state, but the court found that this would severely disrupt the federal government’s detention operations and give California too much power over ICE’s decisions.

The Ninth Circuit sent the case back to the district court to consider remaining legal questions. Though the case is still in its preliminary stages, this decision does not bode well for ending immigration detention in California.

It remains to be seen whether California will appeal the decision to the Supreme Court. For now, the decision signals an uphill battle in the larger fight to end immigration detention across the country. The Biden administration should make good on its promise to end for-profit immigration detention. It can do so by using alternatives to detention, refusing to contract with private prison companies, and closing detention centers.