FILE- In this Feb. 19, 2019, file photo, children line up to enter a tent at the Homestead Temporary Shelter for Unaccompanied Children in Homestead, Fla. The U.S. government didn't have the technology needed to properly document and track the thousands of immigrant families separated at the southern border in 2018. That's according to a new report by an internal government watchdog. (AP Photo/Wilfredo Lee, File)

PHOENIX (AP) — The U.S. government separated thousands of families despite knowing it lacked the technology to document and track their whereabouts, according to a report released Wednesday by an internal government watchdog.

The problem resulted in some parents languishing in custody for weeks without knowing the location of their children.

The report by the Department of Homeland Security’s Office of Inspector General found the agency lacked proper systems when Border Patrol agents took children from parents set to be criminally prosecuted for illegal entry.

Most of those separations took place in the spring of 2018, although the Border Patrol conducted a pilot program the previous summer.

The problem meant agents had to delete prior entries documenting families who arrived together and replace them with references to “single adults” and “unaccompanied children.”

The three agencies dealing with the immigrant families also lacked a cohesive way of tracking each other’s work, the report states.

An email Wednesday seeking comment from Homeland Security was not immediately returned.

The widely decried policy of separating families was meant to deter illegal immigration but was shut down by a U.S. judge who ordered the government to reunify the parents and children. President Donald Trump also signed an executive order to end the practice.

More than 5,400 children were taken from their parents from July 1, 2017, to June 26, 2018.

The new report noted that Border Patrol officials knew they lacked the tracking technology months before the widespread practice began and did nothing to address the issue.

It said reunification was chaotic because it was coordinated via email instead of a shared system that could be accessed by the three agencies involved.

In addition, government employees sent sensitive information about immigrant children through unsecured means, and the number of families needing reunification was too high to manage through email, the report found.

The government has addressed some of the issues but not before family separations were ended, according to the report.

The report was “further proof the Trump administration’s zero-tolerance policy was intended to inflict cruelty on asylum-seekers,” said U.S. Rep. Bennie G. Thompson, the Democratic chairwoman of the Homeland Security Committee. “Family separation stands out as a continual disaster.”

The Trump administration has continued other efforts to reduce immigration, forcing over 55,000 asylum-seekers to wait in dangerous Mexican cities while their immigration cases play out, and requiring thousands more to wait before they can even file an asylum claim.

File - In this July 12, 2019, file photo, protesters hold up a sign that reads 'uncage kids' during a rally in Lafayette Park near the White House where they were calling for and end to immigrant children's detention and family separations. The U.S. government didn't have the technology needed to properly document and track the thousands of immigrant families separated at the southern border in 2018. That's according to a new report by an internal government watchdog. (AP Photo/Jon Elswick, File)