LOS ANGELES — On the same day the Trump administration said it would reunite thousands of migrant families it had separated at the border with the help of a "central database," an official was admitting privately the government only had enough information to reconnect 60 parents with their kids, according to emails obtained by NBC News.

"[I]n short, no, we do not have any linkages from parents to [children], save for a handful," a Health and Human Services official told a top official at Immigration and Customs Enforcement on June 23, 2018. "We have a list of parent alien numbers but no way to link them to children."

In the absence of an effective database, the emails show, officials then began scrambling to fill out a simple spreadsheet with data in hopes of reuniting as many as families as they could.

Click here and here to read the emails.

The gaps in the system for tracking separations would result in a months-long effort to reunite nearly 3,000 families separated under the administration's "zero tolerance" policy. Officials had to review all the relevant records manually, a process that continues.

Nearly a year later, as many as 55 children separated last year under zero tolerance are still in Health and Human Services (HHS) custody at shelters around the country. The shortage of data has also complicated efforts to find many other children, potentially thousands, separated prior to zero tolerance. The administration's lawyers have said in court filings that reunification could take years.

'We may not have some of it'

On June 20, 2018, President Donald Trump ended his separation policy by executive order amidst immense public pressure. Three days later, the Department of Homeland Security issued a fact sheet proclaiming the "United States government knows the location of all children in its custody and is working to reunite them with their families."

The document said that DHS and HHS, the agency that cares for undocumented children when they are separated from their parents, "have a process established to ensure that family members know the location of their children," with "a central database which HHS and DHS can access and update."

But at the time, there was no database with information for both parents and children. Some of the necessary information was missing altogether. Behind the scenes, officials began exchanging emails, provided to NBC News by the House Judiciary Committee, that revealed how unprepared the agencies were to reunite families.

On the afternoon of June 23, Thomas Fitzgerald, a data analyst at HHS, e-mailed Matthew Albence, then the head of Immigration and Customs Enforcement's enforcement and removal operations and now the acting head of ICE. ICE was and remains the agency responsible for detaining, releasing or deporting separated parents.

Fitzgerald asked for "alien numbers" of separated parents to be filled into a spreadsheet of 2,219 children, along with whether or not the parent was already deported, among other information. Alien numbers are assigned to every migrant apprehended by Border Patrol and are how the government tracks them.

A child watches as a Border Patrol agent searches a Central American immigrant after they crossed the border from Mexico in El Paso, Texas on February 1, 2019. John Moore / Getty Images file

Albence replied several hours later. The first line of his email asks, "[A]re you saying you don't have the alien number for any of the parents?"

"[T]he type and volume of what you are requesting," Albence said, "is not something that we are going to be able to complete in a rapid fashion, and in fact, we may not have some of it."

Fitzgerald wrote back to Albence, confirming HHS did not have a way to connect the thousands of children to their parents. He said he had information for a handful of parents, "about 60."

The emails confirm a finding by the DHS Office of Inspector General last September. In a report on family separations, the IG said that conversations with ICE employees indicated there was "no evidence" of a centralized database "containing location information for separated parents and minors."

A former administration official told NBC News that there was a central database, "but the database did not contain enough information to successfully reunite parents and kids. …The information sharing from DHS provided initially was not enough to be able to quickly reunite parents and kids."

Former DHS Secretary Kirstjen Nielsen and other government officials repeatedly claimed that the Trump administration was keeping track of separations. In a June 19, 2018, press conference at the White House, Nielsen insisted all separated children were being tracked.

"It is not that I don't know where they are," said Nielsen. "I'm saying that the vast majority of children are held by Health and Human Services."

Albence did not respond to a request for comment. Fitzgerald referred questions to DHS. DHS said that DHS and HHS took the information about parents entered on spreadsheets and added it to a SharePoint site already populated by HHS with information about unaccompanied children.

HHS referred NBC News to a June 26, 2018 quote from Secretary Alex Azar: "There is no reason why any parent would not know where their child is located. I've sat on the ORR portal with just basic keystrokes, within seconds could find any child in our care for any parent."

In a statement, HHS spokesperson Evelyn Stauffer said, "HHS knows where each and every unaccompanied child in HHS custody is at any given time, and that was true during the summer of 2018. What Secretary Azar said was true and is still true today."

'They didn't communicate'

Three days after the emails between Fitzgerald and Albence, Judge Dana Sabraw of the Southern District of California ordered the Trump administration to reunite families within 30 days.

Once that deadline passed with hundreds of families still waiting in limbo, Sabraw expressed his frustration with the government agencies responsible for reunifying families.

"Each had its own boss," Sabraw said in his San Diego courtroom. "And they didn't communicate, so what was lost in the process was the family. The parents didn't know where the children were, and the children didn't know where the parents were. And the government didn't know, either."

Lee Gelernt, lead lawyer for the ACLU in the separations case, said Wednesday, "It is now clear beyond doubt that the government never had a proper tracking system but unfortunately they pretended in the beginning that they did. It is likely there's still much more for the public to learn about how bad things really were."