ABC News September 27, 2019

Judge blocks Trump plan that would have allowed indefinite detention of migrant families

WATCH: News headlines today: Dec. 23, 2020

A federal judge on Friday blocked the Trump administration’s plan that would have allowed the government to detain undocumented migrant families with children indefinitely.

The ruling was a victory for immigrant rights groups who have said holding children for long periods of time in jail-like settings would be detrimental to their health.

“This victory gives us hope and is a reminder to us all – elected officials, immigration lawyers, organizers, and advocates – to keep fighting," Rep. Joaquin Castro, chairman of the Congressional Hispanic Caucus, said in a statement. '“Flores is not a loophole – it’s a lifesaving standard that protects the basic rights and dignity of migrant children."

Judge Dolly Gee, a district court judge with the Central District of California, said the administration would not be allowed to move ahead with its plan because she said the new rules were "inconsistent" with a decades-long court settlement. The settlement, known as Flores, limits the time children can spend in detention to 20 days and requires that they be kept in safe and sanitary conditions.

In a statement, the Justice Department said it was "disappointed" with the ruling and maintained that the government's plan would have protected children and kept families united, while ensuring due process.

“The Trump Administration will continue to work to restore integrity to our immigration system and ensure the proper functioning of the duly enacted immigration laws," the statement said.

(MORE: Trump administration proposes longer-term detention of migrant families)

The Trump administration in recent weeks has taken several steps to try to deter people from arriving at the U.S.-Mexico border after more than 900,000 undocumented migrants arrived at the border this year alone.

The Department of Homeland Security announced last August that it planned to lift the 20-day cap on child detention so that it could detain migrant families together after they crossed the border. Acting Homeland Security Secretary Kevin McAleenan told reporters at the time that the new rules were needed because asylum seekers were arriving with children so as to avoid lengthy detention. He said being able to hold families until their cases are processed would return "integrity" to U.S. immigration.

"No child should be a pawn in a scheme to manipulate our immigration system," he said.

(MORE: Trump administration to slash refugee program, capping number at 18K)

Earlier this week, McAleenan said the government will also expand a program that forces asylum seekers to wait in Mexico while their asylum cases are processed. As of early this week, the government returned some 48,000 asylum seekers to Mexico. McAleenan said the plan moving forward would be to expand that program to nearly every family trying to cross the border, unless they are deported.

Human rights groups say the policy has resulted in a growing humanitarian crisis that Trump is ignoring.

Trump has defended his handling of the border crisis, declaring this summer to reporters "I have the children on my mind." He said when people realize they won't be able to get into the U.S., they won't come in the first place.

"And many people will be saved. And many women's lives will not be destroyed and ruined," he said.

ABC producers Quinn Owen and Alex Mallin contributed to this report.