As the deportees were led off the plane onto the steamy San Salvador tarmac, an anguished Araceli Ramos Bonilla burst into tears burst into tears, her face contorted with pain: "They want to steal my daughter!"

It had been 10 weeks since Ramos last held her 2-year-old, Alexa. Ten weeks since she was arrested crossing the border into Texas and U.S. immigration authorities seized her daughter and told her she would never see the girl again.

What followed -- one foster family's initially successfully attempt to win full custody of Alexa -- reveals what could happen to some of the infants, children and teens taken from their families at the border under a Trump administration policy earlier this year. The "zero-tolerance" crackdown ended in June, but hundreds of children remain in detention, shelters or foster care and U.S. officials say more than 200 are not eligible for reunification or release.

Federal officials insist they are reuniting families and will continue to do so. But an Associated Press investigation drawing on hundreds of court documents, immigration records and interviews in the U.S. and Central America identified holes in the system that allow state court judges to grant custody of migrant children to American families -- without notifying their parents.

And today, with hundreds of those mothers and fathers deported thousands of miles away, the risk has grown exponentially.

States usually seal child custody cases, and the federal agencies overseeing the migrant children don't track how often state court judges allow these kids to be given up for adoption. But by providing a child's name and birthdate to the specific district, probate or circuit court involved, the AP found that it's sometimes possible to track these children.

Alexa's case began in November 2015 under the Obama administration, after Ramos fled El Salvador to escape what she said was an abusive partner. Her 15-month separation from her mother exposes the fragile legal standing of children under the care of the federal Office of Refugee Resettlement and a flawed, piecemeal system that can change the course of a child's life.

It took 28 minutes for a judge in a rural courthouse near Lake Michigan to grant Alexa's American foster parents, Sherri and Kory Barr, temporary guardianship. Alexa's mother and the little girl's immigration attorney were not even notified about the proceedings.

Based on their experiences with Alexa, the Barrs had become convinced Ramos was a bad mother and that the little girl would be abused if she were reunited with her.

"My wife and I are sick over this," Kory Barr told the judge, as he granted the foster parents' request two days after Christmas.

The federal system that had custody of Alexa says the state courts never should have allowed foster parents to get that far, no matter how good their intentions. Each state court system, from New York to California, runs wardship and adoption proceedings differently, and variations sometimes even exist between counties.

In 2014 in Missouri, a local couple permanently adopted the baby of a Guatemalan mother who was picked up in an immigration raid, after a seven-year legal battle. In a similar case in Nebraska, another Guatemalan mother prevailed, after five years and over $1 million in donated legal work.

The Office of Refugee Resettlement and Bethany Christian Services, the agency that placed Alexa in foster care, would not comment on her case. But Bethany said foster parents are informed they're not allowed to adopt migrant children.

Since the 1980′s, however, Bethany acknowledged that Bethany said that nine of the 500 migrant children assigned to its foster program have been adopted by American families. The children, ages three to 18, were adopted after it was determined it wouldn't be safe or possible for them to go back to their families; at least one asked to be adopted by his foster parents, and another was a trafficking victim, Bethany said.

"We never want families to be separated," said Bethany CEO Chris Palusky. "That's what we're about, is bringing families together."

John Sandweg, who headed U.S. Immigration and Customs Enforcement under the Obama administration, said he worries that many more migrant children recently taken from their families may never see them again.

"We have the kids in the U.S. and the parents down in Central America, and now they'll bring all these child welfare agencies into play," Sandweg said. "It's just a recipe for disaster."

In Alexa's case, pressure from the Salvadoran government, child advocates and a series of viral videos Ramos posted on Facebook expressing her love for Alexa ultimately helped mother and daughter reunite.

A month after the Barrs were granted guardianship of Alexa, the Justice Department weighed in sharply in the Michigan court.

"The Barrs obtained their temporary guardianship order in violation of federal law," U.S. prosecutors argued in early 2017.

The Barrs soon dropped their petition to keep Alexa, writing the judge that the federal government "seems to have us painted into a corner with no way out."

Now back with her mother in El Salvador for more than a year, Alexa has relearned the Spanish she forgot, and has bonded again with her mother and brothers. When she wants attention, she whispers in her mother's ear and she often winds her small arms around her mother's waist and neck.

And every now and then, Ramos allows Alexa to talk to the Barrs, who also love the little girl.

Fearing for the parents separated from their children under the zero-tolerance policy, Ramos recently has taken to Facebook once again -- to urge them to fight to get their kids back.

"Never give up the struggle because we will go to the ends of the earth for our children," she said during an interview. "They are our children, not theirs."