WASHINGTON (Reuters) - The Trump administration’s “zero tolerance” immigration crackdown at the U.S.-Mexico border earlier this year was plagued by a lack of preparation, resource shortfalls and communication failures, according to a government audit released on Tuesday.

FILE PHOTO: Immigrant children now housed in a tent encampment under the new "zero tolerance" policy by the Trump administration are shown walking in single file at the facility near the Mexican border in Tornillo, Texas, U.S. June 19, 2018. REUTERS/Mike Blake/File Photo

The review, conducted by the Department of Homeland Security’s Inspector General, is the first official audit of President Donald Trump’s policy of separating migrant families at the U.S.-Mexico border, criminally prosecuting parents and sending their children to shelters and foster homes across the country.

Trump administration officials have said the policy, under which some 2,600 children were separated from their parents, was needed to secure the border and deter illegal immigration.

Trump was forced to end the policy after widespread public furor over the separations and the chaotic way in which they were conducted, with hundreds of parents deported without their children.

The inspector general’s findings “illustrate the difficulties in enforcing immigration laws that are broken and poorly written,” DHS spokeswoman Katie Waldman said in an emailed statement. “This administration will no longer turn a blind eye to illegal immigration and will continue to refer illegal border crossers for prosecution.”

The audit found that hundreds of migrant children were detained for longer than the three-day limit allowed at U.S. Border Patrol facilities, including one who was held for 25 days.

By law, U.S. Customs and Border Protection (CBP), which has very basic holding facilities, is allowed to detain unaccompanied migrant children for up to 72 hours before transferring them to the custody of the Department of Health and Human Services (HHS).

The audit also found serious issues with how records on separated families were kept. After the separations, the government struggled to “identify, track, and reunify parents and children” in part because technology systems used by agencies within DHS and HHS could not directly share information.

Border Patrol agents did not take measures to ensure that young children who could not yet talk could be correctly identified, failing to provide them with identifying wrist bracelets or fingerprinting or photographing most children, the report said.

Furthermore, claims by DHS in late June that it had a “central database” containing information for separated parents and children were not backed up by the review. The inspector general “found no evidence that such a database exists,” the report said.

As a result, it took DHS “many weeks” to provide the inspector general with basic information on migrant children separated from their parents, and the data, when finally provided, was “incomplete and inconsistent.”

According to a court filing by the government on Thursday, 136 children separated under the “zero tolerance” policy remain in government custody and apart from their parents.