In the filings, attorneys for detainees detailed highlighted the federal governments's own admissions of longer custody times for immigrant children, unsanitary conditions reported by families and monitors at federal facilities, and a renewed reliance on hotels for detention

Nearly 400 immigrant children have been held in Immigration and Customs Enforcement (ICE) custody longer than the legal limit over the summer, the agency admitted in court filings on Monday.

In the filings, attorneys for detainees detailed highlighted the federal governments's own admissions of longer custody times for immigrant children, unsanitary conditions reported by families and monitors at federal facilities, and a renewed reliance on hotels for detention.

The reports were filed in a decades old civil lawsuit started in 1985, which led to the establishment of a landmark policy known as the Flores Settlement Agreement, which limits the amount of time children can spend in federal custody and requires they be kept in safe and sanitary conditions.

READ MORE: ICE agents wrongfully detained US citizen who 'looked Somali' in Minneapolis, city leaders sayREAD MORE: ICE boss whines Minnesota's freezing weather making immigration arrests difficult in 'unrelenting trial and error' raid

President Donald Trump and his administration have been working for the past year to end that agreement. A Dec. 1 report from ICE indicated that about 400 immigrant children were held in federal custody over the 20-day limit during the reporting period from August to September. The filings also detailed the cases of five children who were held for 168 days earlier this year.

The attorneys also told the court that problem was widespread and not limited to any specific facility or region. The primary reasons that prolonged their release were categorized into three groups: transportation delays, medical needs, and legal processing, according to the court filings.

Hotel use for federal detention is permitted under federal law for 72-hours, but attorneys questioned the government's data, which they asserted did not fully explain why the children were held in hotel rooms for more than three days.

Conditions at the detention facilities continued to be an ongoing concern since the family detention site in Dilley, Texas, reopened this year.

Immigrant and child advocate groups documented in the filings various injuries suffered by the children and a lack of access to sufficient medical care.

One child bleeding from an eye injury wasn't seen by medical staff for two days. Another child's foot was broken when a member of the staff dropped a volleyball net pole, according to the court filing. “Medical staff told one family whose child got food poisoning to only return if the child vomited eight times,” the advocates wrote in their response.

“Children get diarrhea, heartburn, stomach aches, and they give them food that literally has worms in it," one person with a family staying at the facility in Dilley wrote in a declaration submitted to the court.

Chief U.S. District Judge Dolly Gee of the Central District of California is scheduled to have a hearing on the reports next week, where she could decide if the court needs to intervene.