An Immigration and Customs Enforcement detention center holding nearly 400 people in Bakersfield, California, that was slated to close will stay open after the U.S. reached a temporary agreement with GEO Group, the private contractor that owns and operates the facility.

The Mesa Verde facility, which is ICE’s only jail in Central California, was slated to shut down March 18, which would have forced ICE to move detainees hundreds of miles to detention facilities around the state or even further.

“Without continued use of the facility, ICE would be required to relocate almost 400 detainees to facilities farther away from their families and attorneys,” ICE said in a statement.

But ICE found a controversial workaround. Citing an “unusual and compelling urgency,” the agency entered into a temporary contract directly with GEO Group, effectively cutting out city government without ICE having to leave.

The exception is intended for use in circumstances like natural disasters or acts of terrorism. In its proposal, ICE argued that it had an “immediate requirement” to continue operating in Mesa Verde.

“The fact that this private company circumvented federal regulations, claiming that they’re facing ‘unusual and compelling urgency,’ is outrageous,” said Ambar Tovar, directing attorney for United Farm Workers Removal Defense Project, which works inside Mesa Verde..

ICE has been struggling to keep its facilities open across California after lawmakers passed a pair of “sanctuary” laws in 2017 that prevent cities and counties from entering into new contracts or from expanding existing agreements with ICE. The laws also gave the California Attorney General’s office, now run by AG Xavier Becerra, increased oversight over the centers.

A report released just last week, the first under the Attorney General’s new mandate, found poor conditions, notably inadequate access to medical care and legal representation, including at Mesa Verde.

In part because of the new regulations, the city of McFarland, outside Bakersfield, ended its contract to operate Mesa Verde in December. The city had been receiving about $35,000 a year for operating as a go-between in ICE’s agreement with GEO Group.

McFarland was the third locality to pull out since the legislation took effect; Sacramento and Contra Costa counties ended their contracts to house detainees in the county jails last year. In those cases, the jails stopped detaining immigrants.

The community backlash to ICE comes as immigrant detention hits an all-time high—50,049 people were detained as of March 6.

Officials have not commented publicly on the city’s decision to end the contract. But a letter from the city notifying the GEO Group of the contract’s termination suggests that it was not over moral concerns but rather because the state’s more aggressive stance against ICE made continuing to work with the agency less appealing.

“This has been a satisfactory arrangement for the City,” city manager John Wooner wrote, “until recent adoption by the State of California of legislation impacting facilities such as Mesa Verde.”

As more cities elect to close their immigration facilities, ICE’s tactic shows a new way for the agency to effectively nullify the decisions of local governments. Mesa Verde will stay open for another year, without ICE having to go through the standard time-consuming public bidding process normally required for government contracts.

Even if immigration advocates oppose ICE’s methods, they’re more ambivalent about the outcome. “We definitely don’t think that it is humane to continue to detain people simply because they are fleeing persecution,” Tovar, the immigration attorney, said. “On the other hand, it is also a relief that clients we do represent are not going to be transferred to another location.”

Liz Martinez, director of advocacy for Freedom for Immigrants, which helped draft the 2018 laws, sees the steps ICE took to keep Mesa Verde open as a way for the agency “to circumvent the intention of the law.” Martinez says the group will take it into account when proposing legislation in other states.

“Anything that involves ICE has to be enforceable,” she said. “They’re not going to police themselves, and they’re not going to be beholden to anything unless it is written in law.”