But those precautions were undermined in some cases by the other federal agency that has initial custody of apprehended migrants in the first 72 hours after they cross the border — Customs and Border Protection. In hundreds of cases, Customs agents deleted the initial records in which parents and children were listed together as a family with a “family identification number,” according to two officials at the Department of Homeland Security, who spoke on the condition of anonymity because they were not authorized to discuss the process.

As a result, the parents and children appeared in federal computers to have no connection to one another.

“That was the big problem. We weren’t able to see that information,” said one of the officials, who is directly involved in the reunification process.

Officials cautioned that this was not a deliberate attempt to obfuscate, but a belief that it made more sense to track cases separately once a group of migrants was no longer in custody as a family unit, these sources said.

Katie Waldman, a spokeswoman for DHS, disputed the description of events at the border and said that the agency had always provided clear information to HHS linking parents and children to one another.

“Not only is it categorically false that DHS destroyed records, but the opposite is true: DHS personnel has worked hand-in-hand with HHS personnel to share clear data in the most useful formats possible for HHS – which included names, dates of apprehension, and identifying alien numbers for both children and parents who were separated as a result of zero-tolerance,” she said in a statement.

Over the past week, the Health and Human Services Department has been forced to undertake a herculean effort, deploying hundreds of federal workers, to comply with an injunction of a federal judge in San Diego, who ordered that all families separated under the policy must be reunited by July 26. The deadline for children under the age of 5 was set for Tuesday.