Here's how the Trump administration plans to reunite thousands of immigrant kids who were separated from their parents

A child from Honduras is brought to the US Immigration and Customs Enforcement office in Grand Rapids, Michigan on July 10, 2018. Associated Press/Paul Sancya

The government submitted a plan to a federal judge over the weekend on how it intends to reunite the thousands of older immigrant children it separated from their parents.

The Trump administration is racing against a July 26, court-ordered deadline to reunite 2,551 children between the ages of five and 17.

The government has so far reunited at least 58 of 103 children younger than five.

The Trump administration is fast approaching a court-ordered July 26 deadline to reunite the 2,551 children between the ages of five and 17 that it separated from their parents in recent months.

The effort is the culmination of months of controversy around the Trump administration's now-halted "zero tolerance" policy, which sparked a public uproar, prompted multiple lawsuits, and resulted in a federal judge ordering the government to reunite the families within weeks.

The government submitted court documents over the weekend laying out exactly how those reunifications will proceed — and it's gearing up to be a complex, multi-agency effort:

First, parents are checked against multiple criminal databases maintained by ICE and the FBI.

Simultaneously, case managers will review whether the children have expressed anything indicating safety concerns with the parent, or doubts that the adult really is their parent.

If neither process raises red flags about the parents, then the government will refer them for interviews and ICE will determine whether they have any open deportation orders.

ICE will then determine whether the parent wants to be deported without their child. If not, they'll be moved to one of several ICE facilities to be interviewed.

The Health and Human Services Department will then complete a 15-minute interview for each parent, and if no red flags come up, they'll be reunited with their child at the ICE facility.

Here's a flowchart the government provided about the reunifications:

The Department of Homeland Security and The Health and Human Services Department

But the process starts to get tricky if questions surface about the parents' criminal history, parentage, or deportation status, or if the child has become ill while in government custody.

Parentage doubts can mostly be resolved with a DNA test or examining documents like birth certificates, but other red flags could mean the child remains in government care before they're placed with other relatives or family friends known as "sponsors."

Government lawyers said in their court filing that the Trump administration is "devoting extraordinary resources to comply fully with this Court's orders, and to do so in good faith."

At a Monday hearing, US District Judge Dana Sabraw called the government's filing a "good plan," but urged speed.

"No matter how nice the environment is, it's the act of separation from a parent, particularly with young children, that matters, and it's time that is the issue," he said.

Why the reunifications have taken so long

There are several reasons why the process has been so slow to get started and requires so many steps — and many of them stem from the government's own actions when officials first processed the immigrant families at the border.

The deletion of those records meant that immigrant parents and their children appear as separate individuals in federal computers, making it impossible to tell who is related to whom, or whether the immigrants crossed the border alone or with relatives.

A Honduran child plays at the Catholic Charities Humanitarian Respite Center after recently crossing the US-Mexico border with his father on June 21, 2018 in McAllen, Texas. Getty Images/Spencer Platt

Parents were transferred to Immigration and Customs Enforcement custody and either detained, released on bond pending their asylum cases, or deported.

But children were placed in the custody of the Health and Human Services department — a completely separate entity from ICE — and flown to shelters or foster families across the country.

From there, children were expected to follow the same process as children who arrive in the US unaccompanied: the government intended to eventually release them to relatives or family friends known as "sponsors" while their asylum claims wound through the immigration court system.

The Trump administration has said in court filings that ICE has faced challenges locating the parents who were released on bond or deported, and it's unclear whether the government can reunite all of the families it split apart.