The Obama administration has issued a new policy limiting the use of solitary confinement in federal immigration detention centers.

The move follows intense criticism of the practice from immigrant rights groups. And it comes amid a congressional debate on overhauling the nation’s immigration system.

Critics object to isolating people who are being detained for immigration violations, which are civil offenses. They also worry about the psychological harm solitary confinement may do.

But advocates for stricter immigration enforcement point out that many people held in immigration detention centers have been convicted of serious crimes. They said federal authorities must have the option to segregate them so they can keep their detention centers safe.

Issued Wednesday, the new U.S. Immigration and Customs Enforcement directive says solitary confinement should be used “only as a last resort” for people with special vulnerabilities, including mentally ill people, the elderly, and pregnant or nursing women. It says alternatives to isolation should be considered. And it mandates new reporting requirements and oversight.

The Atlanta Journal-Constitution reported in April that ICE, on average, places about 300 immigrants in solitary confinement each week. At the Stewart Detention Center south of Atlanta, about 20 detainees facing deportation, on average, were isolated this way each week across more than four months last year, ICE’s records show.

This is the second new directive ICE has issued in two months concerning illegal immigrants held in federal detention centers. Last month, ICE instituted a new policy that says the government should detain them as close as possible to their children, allow them to visit each other and transport detainees to family court proceedings.

In June, the Democratic-led U.S. Senate passed omnibus immigration legislation that includes new limits on the use of solitary confinement in immigration detention centers. The GOP-controlled U.S. House has refused to take up the Senate bill, partly because it includes a pathway to citizenship for immigrants living illegally in the U.S.

ICE issued a statement Thursday saying its policy stems from a review of its practices.

“Placement of detainees in segregated housing is a serious step that requires careful consideration of alternatives,” ICE said in its statement.

The National Immigrant Justice Center, a Chicago-based immigrant rights group, applauded ICE’s move.

“We were thrilled to see that the administration acted so quickly on this in terms of just improving oversight of immigration detention facilities and the use of solitary confinement,” said Mary Meg McCarthy, the center’s executive director.

A spokesman for the Federation for American Immigration Reform, a Washington-based organization that supports tougher immigration enforcement, said FAIR was evaluating the new policy Thursday and had no immediate comment.