None of the families had a lawyer or a clear idea of how to survive, much less feed their families back home in Afghanistan. Most began writing desperate messages to migrant aid organizations, but the groups were overwhelmed, and the Afghans rarely heard back.

Mozhgan’s family faced a different terror: She had gone missing.

She had scaled the first border fence, then spent three nights between the walls. Finally, immigration officials carted her family to detention — but she and an older brother, both over 18, were treated as single adults and kept in custody, while the rest of the family was released in California.

They had fled Afghanistan together and spent months trekking through unforgiving terrain, evading bandits and dodging corrupt police officers — only to be separated, without any contact, in the country where they hoped to find refuge.

Her mother, Anisa, was frantic, said Mozhgan’s father, Abdul. “We might not be able to see them again,” he recalled her saying.

Their children were released about a week later and reunited with the family.

Taiba kept moving. In early May, an aid group in New York offered a spot in a shelter and the family headed east, bound for more uncertainty. Without asylum, they faced a life in the shadows, like millions of other undocumented immigrants in the United States.

Her husband had always assumed the Darién would be the hardest part of the journey.

“But when I emerged from the jungle, we have seen, ‘No,’” he said. “The difficulties are forever.”

Federico Rios contributed reporting from Brazil, Mexico and the Darién Gap, and Ruhullah Khapalwak from Vancouver.