The Trump administration has been illegally holding unaccompanied migrant children in unlicensed facilities in violation of a federal agreement designed to protect them, attorneys say.

Peter Schey, one of the lead attorneys representing detained children, told The Hill he sent the Justice Department a letter outlining a series of violations, including about 10 or 12 facilities that failed to produce licenses when inspected.

Among them was the largest facility for unaccompanied children in the country, located in Homestead, Fla.

The letter was first reported by CBS News, and confirmed to The Hill by Schey, who described its contents.

Schey said he is preparing to file a motion in the coming days, alleging numerous violations of the Flores agreement from the Departments of Justice (DOJ) and Health and Human Services (HHS).

"I don't think they're ignorant of this, they know they're violating federal law," Schey said of the HHS Office of Refugee Resettlement, which oversees the facilities for detained migrant children.

The Flores agreement has governed the detention of migrant children since 1997. The agreement mandates that children must be held in the "least restrictive" facility that meets state regulations.

The government must also provide reasonable accommodations for private visitation and contact with families.

Detaining children for more than 20 days is illegal, but the current "influx" situation means only that the children must be released to a sponsor as "expeditiously as possible."

Most administrations interpreted that to mean children were released within 10 days, Schey said, but that hasn't been the case under the Trump administration.

Migrant children's time in government custody has grown longer, in part due to the new policies that make sponsors afraid to come forward because of immigration enforcement.

Schey said the administration has intefered in the children's release by engaging in "extreme vetting" of potential sponsors by running their fingerprints through FBI databases, and then turning those sponsors over to Immigrations and Customs Enforcement if they are in the country illegally.

"People are seriously discouraged to come forward and get their children out of custody," Schey said. "They used the process to apprehend parents. We don't want children held as bait to force their parents to come get arrested and deported."

An HHS spokesperson said the agency is reviewing the letter, but would not comment "on an ongoing legal matter."

HHS operates a network of just over 100 facilities for unaccompanied migrant children across the country, and each one is supposed to be licensed by the state where it is located. According to Schey, unlicensed facilities are not able to access key databases, including state child abuse and neglect background check system.

The Flores agreement allows Schey's team to inspect any Office of Refugee Resettlement facility across the country with as little as one weeks notice.

Under current law, migrant children who illegally cross into the U.S. must be sent to a government shelter where they stay until they can be united with relatives or other sponsors while awaiting immigration court hearings.

The administration is working on new regulations that it says would terminate and replace the Flores agreement.

The proposal would allow immigration officials to keep children and their parents detained together for the entire length of their court proceedings, which could take months.