PHOENIX — Half a dozen families who were separated at the U.S.-Mexico border are still detained in Texas months after reuniting with their children.

Immigrant advocates say the government has violated a longstanding legal agreement that bars it from detaining children past 20 days in unlicensed facilities like the South Texas Family Residential Center.

The detention center in Dilley, Texas, had been holding about 40 families for four months following the court-ordered reunifications. About 30 of the families were just released last week.

"We are still suffering because they don't want to set us free," said Wendy, a woman from El Salvador who arrived in the U.S. with her 9-year-old daughter in late May.

Wendy, who did not want her full name used for fear of her safety, was separated from her daughter, then reunited after nearly two months. The Associated Press spoke with her in September, and it's not immediately clear if she's been released yet.

Many families had spent months apart after President Donald Trump's administration launched a zero-tolerance policy requiring anyone who crossed the border illegally to face criminal charges. That meant parents had to go to court while their kids went to shelters for underage immigrants nationwide.

The policy ended in the spring after worldwide uproar, but families with parents who failed their first screening as they sought asylum have remained in custody with their children.

A decades-old agreement known as the Flores settlement dictates how long the government can keep children in unlicensed facilities. Generally, the rule has been that kids can't be kept past 20 days.

Families still detained in Texas said in interviews with The Associated Press that they are desperate and that their kids are traumatized.

One woman said she and her daughter kept getting sick during the rainy season because officials at the Texas center wouldn't let them change out of wet clothes. The dorms at Dilley are outside.

U.S. Immigration and Customs Enforcement spokeswoman Dani Bennett said the agency takes the health, safety and welfare of immigrants in their care very seriously. She said the agency provides comprehensive medical care, including nurses, mental health providers, doctors, dental care and access to 24-hour emergency care.

"Pursuant to our commitment to the welfare of those in the agency's custody, ICE spends more than $250M annually on the spectrum of health care services provided to those in our care," Bennett said in a statement.

The families who remained detained long after reunification are asylum seekers who failed what's known as a "credible fear" interview — the first step in the process. An asylum officer interviews asylum seekers about why they fled their country, and if they can show they have credible fear of returning, they get a hearing before an immigration judge.

A federal judge ordered the government to allow those families to redo their interviews after attorneys sued, saying parents didn't pass the initial screening because of the extreme stress of having their kids taken away.

"Every step of the way, the government has really taken its time," said Katy Murdza, an advocacy coordinator with CARA Pro Bono, which provides legal services to hundreds of families detained in Dilley. "Meanwhile, there is more and more harm being done to these children."

Bennett, the ICE spokeswoman, said the average length of a stay at the Texas center is 17 days. She said the length of some families' stay could be longer than 20 days depending on individual circumstances, like those who have final orders of removal from the U.S. Many of the families kept this long have such orders.

They're likely to get another shot at staying in the U.S., though, because of the agreement that allowed them or their children to do another initial interview.

"It's very traumatizing to be detained," Murdza said. "We start to see behavioral regression, wetting the bed, refusing to be separated to go to school."