WASHINGTON (WPRI/AP) — A Massachusetts jail that has drawn complaints of inhumane conditions will no longer be used to detain immigrants, the Biden administration said Thursday.

The Department of Homeland Security said it would terminate contracts with the local government agency that runs the detention center in North Dartmouth.

Any detainees the U.S. believes should remain in custody will be transferred elsewhere, Homeland Security Secretary Alejandro Mayorkas said in announcing the move, which had been sought by immigrant advocates.

“Allow me to state one foundational principle,” Mayorkas said, “We will not tolerate the mistreatment of individuals in civil immigration detention or substandard conditions of detention.”

Mayorkas said ending the use of the facilities is part of an effort to make “lasting improvements” to a detention system that advocates have long argued detains people for civil immigration offenses for too long and in inappropriately harsh conditions.

It also reflects a broader effort to roll back the anti-immigrant policies that characterized U.S. policy under President Donald Trump.

Immigration and Customs Enforcement, a part of DHS, holds about 19,000 noncitizens for removal at about 200 facilities around the country, down about a quarter from a year earlier. About 73 percent of those in custody have no criminal record and many others have only minor offenses, according to the Transactional Records Access Clearinghouse, a data-gathering organization at Syracuse University.

The DHS is also terminating its contract with a detention facility in Georgia where women claim they were subjected to unwanted medical procedures. DHS suggested additional detention facilities could close in a statement that noted that it would “review concerns” about other centers.

“Today’s announcements show the Biden administration’s willingness to decisively break from the immigrants’ rights abuses of prior administrations,” said Naureen Shah, senior advocacy and policy counsel at the American Civil Liberties Union, which recently called for the closure of 39 immigration detention centers around the country.

The ACLU has called for an end to the “default incarceration” of immigrants and an end to the agreements with state and local authorities that enable prisoners who are noncitizens to be transferred into ICE custody for deportation upon release.

Mayorkas has led an effort to soften some immigration policies but has insisted that noncitizens who pose a threat to the public and have committed serious crimes should be detained pending their removal from the country.

The Bristol County Sheriff’s Office operated the Massachusetts immigration detention center jail under an agreement with DHS. The Georgia facility was run by a private company under contract with the government.

Members of Congress and advocates have called for the closure of the Georgia facility since last year after women held there said they were forced into unnecessary gynecological procedures with dirty equipment that led to serious infections.

DHS and the Justice Department are investigating the allegations of medical mistreatment, which a doctor involved in their treatment has denied, and Mayorkas said that steps will be taken to preserve evidence.

Immigrants held at the Georgia facility, which has held an average of fewer than 300 detainees per day in recent months, also had broader complaints about overall conditions, alleging that authorities at the detention center failed to take adequate measures to prevent the spread of COVID-19.

“Given its extensively documented history of human rights violations, Irwin should have been shut down long ago,” said Azadeh Shahshahani, legal and advocacy director for Project South, an advocacy group that has pressed for ICE and the company that runs the facility to compensate any women subjected to unwanted procedures there.

The facility has been used to house men and women for ICE as well as inmates for the U.S. Marshals Service and Irwin County. It’s run by the private LaSalle Corrections, a Louisiana company. The company had no immediate comment to Thursday’s announcement.

mmigrants held at the Massachusetts jail, known formally as the C. Carlos Carreiro Immigration Detention Center, have also complained about a lack of COVID-19 precautions as well as overcrowding and excessive use of force.

Massachusetts Attorney General Maura Healey issued a scathing report in December, determining that officers violated the rights of detainees and used excessive force during a disturbance there earlier in the year.

She commended DHS for terminating its contract with the Bristol County Sheriff’s Office.

“Our extensive investigation and advocacy have made it clear that the Sheriff’s Office is not willing to take any steps to protect the rights and safety of detainees, and that ICE must sever ties with BCSO,” she said in a statement. “This decision under the Biden administration ensures that the civil rights of immigrants are protected and not violated in a callous disregard for human life and dignity.”

Bristol County Sheriff Thomas Hodgson, a Republican who served as honorary chairman of Trump’s reelection campaign in Massachusetts, dismissed Thursday’s decision as a “political hit job” by the administration and said it puts people at risk of being victimized by immigrants.

There are 7 detainees currently held at the Bristol County jail, down from about 150 early in the pandemic, according to Iván Espinoza-Madrigal, head of Lawyers for Civil Rights, which filed suit against the government last year to address what it said were unsafe and overcrowded conditions.

Immigrant rights groups have frequently clashed with Hodgson over conditions at the jail, about 60 miles south of Boston near Cape Cod, and they cheered the decision as long overdue.

“Sheriff Hodgson has inflicted grievous harm on vulnerable immigrants in his custody for years,” said Espinoza-Madrigal. “And we enthusiastically applaud the Biden Administration’s decision to put an immediate end to the abuse.”