SANTA FE, N.M. (AP) — New Mexico legislators introduced a bill Tuesday that would prohibit local governments and state agencies from contracting to detain immigrants in civil cases with U.S. Immigration and Customs Enforcement and private detention facilities.

The bill could unwind contractual agreements that help detain immigrants at three privately operated detention centers in New Mexico within close driving distance of the U.S. border with Mexico.

The proposal was sponsored by Democratic state Sens. Jerry Ortiz y Pino and Moe Maestas, both of Albuquerque, with the backing of advocacy groups that are critical of U.S. policies and practices in migrant detention.

The bill resembles recently enacted legislation in New Jersey, Virginia and Illinois aimed at ending detention in civil immigration cases in local facilities.

It was unclear whether Democratic New Mexico Gov. Michelle Lujan Grisham supports the newly filed legislation.

Proponents of the proposed legislation include the New Mexico Immigrant Law Center, Innovation Law Lab and New Mexico Dream Team.

California’s 2019 ban on privately owned immigration detention facilities was rejected last year by a federal appeals court that cited interference with the federal government’s authority to enforce immigration law.

The Torrance County Detention Facility is shown on Thursday, Sept. 29, 2022 in Estancia, N.M. (AP Photo/Andres Leighton)

In New Mexico, private companies operate the Torrance County Detention Facility in Estancia, Cibola County Correctional Center in Milan and the Otero County Processing Center in Chaparral under service agreements with county governments and ICE.

The Torrance County Detention Facility, privately operated by CoreCivic, was the focus of a scathing inspection report after an unannounced visit in early 2022 by the Department of Homeland Security Inspector General, which found unsafe and unsanitary conditions and recommended the relocation of detained migrants.

The findings were disputed by CoreCivic and ICE. A follow-up inspection by the inspector general showed compliance with 10 of its 14 recommendations.

U.S. Sens. Martin Heinrich and Ben Ray Luján last year urged the federal government to terminate its contract at Torrance County with CoreCivic.