(CNN)A federal judge in California blocked the Trump administration's proposal to detain undocumented families together indefinitely.
At issue was what is known as the Flores settlement that requires the government to release a minor from a non-licensed facility as expeditiously as possible, which has been set at 20 days. The administration has wanted to scrap the 20-day limit.
"The blessing or the curse -- depending on one's vantage point -- of a binding contract is its certitude. The Flores Agreement is a binding contract and a consent decree," US District Judge Dolly Gee said in her ruling. "Defendants cannot simply ignore the dictates of the consent decree merely because they no longer agree with its approach as a matter of policy."
Gee shared a tentative ruling with plaintiffs and defendants that provided a window into her decision prior to Friday's hearing.
"There wasn't a whole lot to be discussed given her conviction that the final regulations were inconsistent with the settlement agreement," said Neha Desai, co-counsel for Flores and director of immigration at the National Center for Youth Law.
"We know that this is not the end of the fight. We anticipate the defendants will appeal the ruling and we're ready to vigorously defend the agreement if and when it goes up on appeal," Desai added.
Last month, the Department of Homeland Security unveiled a proposal that would give the government new licensing authority, allowing the use of either a state license or Immigration and Customs Enforcement detention standards, meaning families can be kept longer than 20 days.
The Trump administration has been pushing to end the settlement, arguing the restrictions get in the way of immigration enforcement. Last year, the administration revealed its proposed federal regulations to nullify the court case.
Following the administration's announcement, attorneys moved to block the proposed change, saying it would violate the settlement. The judge put the ruling on hold until the regulation was finalized, which occurred in August.
A cluster of plaintiffs' lawyers celebrated the ruling outside the US District Court in the Central District of California, calling it a victory for undocumented children.
"I'm elated, I was in tears when I heard the tentative ruling," said Holly Cooper, co-director of the Immigration Law Clinic at University of California, Davis.
Lawyers for the government declined comment after the hearing, which included the judge questioning their arguments to roll back the Flores agreement.
"Just because you tell me it is night outside, does not mean it's not day," Gee quipped.
A Justice Department spokesman issued a statement later in the day, saying, "The Department of Justice is disappointed that the court is continuing to impose the outdated Flores Agreement even after the government has done exactly what the Agreement required: issue a comprehensive rule that will protect vulnerable children, maintain family unity, and ensure due process for those awaiting adjudication of their immigration claims. 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 settlement has been a continued point of contention, as administration officials argue it would ultimately deter migrants from journeying to the US-Mexico border and advocates push back against the prolonged detention of children.
California Attorney General Xavier Becerra and Massachusetts Attorney General Maura Healey, along with 18 other state attorneys general, also announced a lawsuit challenging the Trump administration's new rule.
Over the course of the year, there's been an uptick in family apprehensions at the southern border. So far this fiscal year, Border Patrol has arrested more than 457,000 families for illegally crossing the border, though numbers have begun to decline in recent months.
Earlier this summer, the overcrowding at facilities sparked a national outcry, as a team of doctors, lawyers and advocates warned of what they said were major health and hygiene problems at several US Customs and Border Protection facilities in Texas.
The visits were negotiated with CBP because the team was monitoring government compliance with the Flores settlement.