California Governor Gavin Newsom signed a bill into law on Friday that will phase out private prisons—including federal immigration detention centers—throughout the state. The new law, AB 32, prohibits the state government and U.S. Immigration and Customs Enforcement (ICE) from creating, modifying, or renewing prison contracts with private companies beginning on January 1, 2020.

The law orders the complete elimination of California’s private prisons by 2028, but the contracts of the four existing immigration detention centers in the state are set to expire within the next year. These facilities currently hold approximately 4,000 immigrants and are run by for-profit, private prison companies such as GEO Group and CoreCivic. After the private facilities close, the Yuba County Jail will have the last remaining ICE contract in California.

The new California law goes the furthest in the United States in limiting immigration detention.

Illinois banned local government transactions with private detention centers earlier this year but does not prevent ICE from contracting directly with corporations. Several states have banned private contracts in the criminal justice system without affecting immigration detention.

California had already demonstrated leadership in limiting private detention facilities. In 2017, the Dignity Not Detention Act prevented local governments from expanding private immigration detention contracts. The law also expanded state oversight over existing detention centers.

About 70% of the approximately 50,000 people in immigration detention in the United States are held in private facilities. Private detention incentivizes unnecessary increases in the U.S. detention population when alternatives to detention have proven effective. These alternatives cost about $4 per day per person, compared to $139 for adult detention, and $319 for family detention.

Advocates and government watchdogs have long denounced dangerous conditions at for-profit detention centers around the country.

This summer, the Department of Homeland Security’s Office of the Inspector General issued a report on egregious violations of government standards in four detention centers, including the Adelanto detention center in California. Inspectors found nooses in detainee cells, food safety issues, and inappropriate segregation practices.

Advocacy organizations have filed many complaints on a wide range of problems at other for-profit facilities, including conditions for pregnant women, the practice of detaining infants, and inadequate medical care.

Last week’s law is a huge step toward limiting immigration detention, but much will depend on what comes next.

If the detention centers do close, it is crucial that ICE respond by releasing people instead of just transferring them to other parts of the country. Transfers could take people to even more remote locations with less access to attorneys and less state oversight. For this reason, a recent report recommended that states focus on increasing investigations, regulations, and reporting on detention facilities instead of eliminating them.

It is likely that the federal government will fight AB 32 in court. However, California’s state Senate Judiciary Committee has predicted that the state would win such a challenge. These developments in California may even spark similar legislation in other parts of the country.

Increased oversight of immigration detention centers—both private and public—is critical to ensure that people are treated humanely and are afforded meaningful due process.