Courtesy of RAICES Busloads of mothers and children were dropped off in San Antonio after their release from family immigrant detention.

Hundreds of women and children were released from two family detention centers over the weekend, after a Texas state judge sided with critics who say the facilities more closely resemble jails than child care centers.

The mass releases were a victory for immigrant rights advocates, who argue that it’s unnecessary and inhumane to lock up undocumented mothers and kids seeking asylum in the U.S.

The state lawsuit focused narrowly on emergency rules designed to allow the detention facilities to meet Texas’ child care licensing standards. But the state case arises out of ongoing federal litigation, which has put Immigration and Customs Enforcement on notice that these facilities are not acceptable places to house kids.

“This may not be the end of our legal battles,” said Bob Libal, executive director of Grassroots Leadership, which brought the state lawsuit. “But for now, if these facilities want to apply to operate as child care facilities, they have to do it like any other child care facility ― rather than the state designing a rule that fits prisons.”

Mothers and kids, most of them from Central American countries, can languish at the detention centers for months while their cases move forward in immigration court. The lucky ones are released to sponsors, often family members, so ICE knows where they are.

But they usually trickle out just a few at a time.

The next stop for many is RAICES, a San Antonio nonprofit about an hour away from the facilities. RAICES feeds the families, helps them arrange travel and gets them to the bus station or airport. ICE will normally call or email to say that it’s planning to drop off people later that day, said Amy Fischer, policy director at RAICES. A typical daily caseload would be three families.

This past weekend, however, the families began arriving by the busload ― more than 460 on Saturday and Sunday alone, according to RAICES. The situation exploded “times a million,” said Fischer.

She told HuffPost that the numbers arriving this past weekend alone surpass the shelter’s average monthly caseload for the year so far.

The final busload of the weekend rolled in not long after midnight Monday morning, she said. Since the sun has risen, Fischer added, about 40 more people have arrived, and ICE warned them to expect another three buses.

For its part, ICE denied that the releases had anything to do with Friday’s court ruling and said they were previously scheduled. Spokesman Carl Rusnok said the agency “is currently reviewing the court’s ruling on the matter of the operating license for the South Texas Family Residential Center. Operational activities continue without interruption at this time.”

Courtesy of RAICES Women and children gather in a church after being released from family immigrant detention centers in Texas this past weekend.

Meanwhile, the folks at Casa RAICES in San Antonio are pressed. Their operation isn’t designed to deal with hundreds of people at once. The main house has 27 beds, plus there are air mattresses and floor space in another house nearby. The record for people going through the facility in a single day was 101 mothers and children, staffers said during a tour just before Thanksgiving.

With the flood of newcomers this weekend, people are sleeping in the hallways at Casa, Fischer said. A local church and a convent took many in as well. But RAICES is still helping the families with travel plans and providing them with backpacks of donated supplies, including warm clothes, bottled water, snacks and diapers.

The release mothers and children is welcome, even if the numbers are a challenge, Fischer said.

“No matter what type of stress this puts on our resources, we have been pushing for the end of family detention ..., so we are immensely happy that these families are being released,” she said. “We hope that they continue to be released until the family detention centers are empty.”

The Obama administration rapidly expanded family detention ― a policy it had all but abandoned shortly after President Barack Obama took office ― to act as a disincentive to the tens of thousands of Central American families crossing into the United States since the summer of 2014. These families routinely apply for asylum or other forms of humanitarian relief. But given immigration court backlogs, they can be stuck for months in detention centers.

Last year U.S. District Judge Dolly Gee ruled that the family detention policy violated a 1997 court settlement requiring that undocumented children be housed in the least restrictive setting possible and generally favoring their release from detention. In response, the Texas Department of Family and Protective Services issued new rules defining “child care facility” to make it possible for the two detention centers to qualify.

Whether you have nice furniture, colorful walls and happy suns, it doesn’t mitigate the fact that these are prisons for children. Luis Zayas, professor of social work at the University of Texas at Austin

Texas issued a temporary license to one of those sites, the Karnes Family Residential Center, to act as a child care facility in May. Grassroots Leadership filed the state lawsuit before the South Texas Family Residential Center in Dilley could likewise obtain a license.

But Friday’s ruling in favor of Grassroots Leadership invalidated the state’s attempt to bend the rules. Without those licenses, the two family detention centers once again run the risk of running afoul of Judge Gee’s federal ruling.

Lawyers from the Texas attorney general’s office and the Department of Family and Protective Services were still reviewing the state court’s decision on Monday and had not yet decided whether to appeal, according to department spokesman Patrick Crimmins.

Luis Zayas, a professor of social work at the University of Texas at Austin who testified in the state case as an expert witness, applauded the ruling.

“This really affirms the fact that the Texas Department of Family and Protective Services had erred in changing their own rules that protect children in the interest of private prisons, who are there to make money,” Zayas told HuffPost. “These are not, by any means of the imagination, child care facilities. Whether you have nice furniture, colorful walls and happy suns, it doesn’t mitigate the fact that these are prisons for children.”

The GEO Group, the private company that runs the Karnes detention center for ICE, downplayed the significance of Friday’s ruling, saying the facility would continue to operate. The center “has always been in compliance with ICE’s Family Residential standards,” said GEO Group spokesman Pablo Paez in an email.

“As an added oversight step, our company and ICE pursued the licensing of the Center by the State of Texas,” Paez said.

CoreCivic (formerly the Corrections Corporation of America), which runs the Dilley detention center, “stand[s] ready to support the needs of our government partner, while providing a safe, humane and appropriate environment for those entrusted to our care,” spokesman Jonathan Burns said in an email.

The Karnes and Dilley detention centers would need to make significant changes to qualify as child care facilities under previously established Texas law. One problem is that the centers hold multiple families together in a single unit, meaning children have been housed with unrelated adults ― a generally prohibited practice for child care facilities because of the risk of abuse.

Another key issue is that children’s presence at licensed child care facilities is essentially optional and they can leave. By contrast, kids can’t leave the detention centers at Karnes or Dilley unless ICE or an immigration judge releases them.

Despite the ongoing litigation, ICE extended CoreCivic’s contract to run the Dilley detention center in October.

Update: On Tuesday, an ICE spokeswoman confirmed that the agency had released 470 mothers and children on Saturday ― 61 individuals from the Karnes facility and 409 from the Dilley facility. There were still 2,479 mothers and children in family immigrant detention centers as of Monday, according to the spokeswoman. Dilley held 1,787 people; Karnes held 606; and a third facility, the Berks County Residential Center in Pennsylvania, held 86.