The Trump administration separated thousands of migrant children from their parents and then lost track of them after they were released from custody — long before the practice of family separation became formalized under the administration's “zero tolerance” policy last year.

That’s according to a new report by the Inspector General for the Department of Health and Human Services released Thursday, which shed light on the utter chaos in the implementation of the immigration policy.

The report identified a spike in family separations beginning in the summer of 2017, and found that HHS officials failed to make records of what happened to children after they were released from Office of Refugee Resettlement custody, including whether they were reunified with parents or non-relative sponsors.

In June, the administration announced its “zero tolerance” immigration policy, which included separating migrant children from their parents if they were brought into the U.S. illegally. But the report shows the Trump administration had been separating children for at least a year prior, in order to prosecute the parents.

A class action filed in June 2018 challenging the administration’s policy on behalf of parents led to a federal court order requiring the government to end its family separation practice and reunify the 2,737 children in its care with their parents.

But because of poor record-keeping, the Trump administration was unable to do so for thousands of children.

“We don’t have any information on those children who were released prior to the court order," said Ann Maxwell, assistant Inspector General for HHS, on a press call Thursday.

Before the court order, HHS says they were not legally required to identify or track children who had been separated from their parents. Officials told the Inspector General that they estimate “thousands” of children were taken into custody before the court order, not marked as separated from their parents, and then released.

Even reunifying families covered by the court order has been chaotic, the Inspector General found.

“Due to the lack of an existing, integrated data system to track separated families across HHS and DHS and the complexity of determining which children should be considered separated meant that the list of families entitled to reunification was still being revised as late as December 2018, more than 5 months after the order’s effective date,” the report states.