EL PASO, Texas — Six-month-old Alan Ivan gurgled in his mother's arms, round cheeks fattening into a smile as she bounced him up and down. He was a happy baby, oblivious to the distance he had just traveled or what it might mean for his future.

For almost 10 days, Micaela, 20, and her son had slept on buses throughout Mexico. They had left their home in a mountain region of Guatemala to try to unite with Micaela's husband and daughter in Alabama. But like thousands of families who attempt to come to the U.S., they were apprehended by the Border Patrol. That night, they slept on the floor of a frigid holding cell.

"We suffered," she said.

But Micaela and those who slept beside her may have been among the lucky ones. They arrived in a moment of limbo, between the end of a federal policy that separated families, and the beginning of the Trump administration's plans for what may become a detention system to hold immigrant families by the thousands.

Micaela, 20, holds her 6-month-old infant in her arms as she waits for a volunteer pediatrician to examine him. Micaela entered the U.S. with several other women and children, all from Guatemala. Micaela was fitted with ankle monitors and permitted to stay in the U.S. as her immigration case went forward. Hannah Rappleye / NBC News

Since April, when Attorney General Jeff Sessions unveiled a "zero-tolerance" policy, the government has routinely brought federal criminal charges against migrants apprehended crossing the border without authorization, including parents traveling with children. Parents went to jail while their children were dispersed to a vast network of shelters across the country for "unaccompanied minors."

But on Wednesday, the day after Micaela was apprehended, President Donald Trump signed an executive order effectively halting the family separations that his own administration had instituted.

The president's about-face came after a firestorm of protest about the callousness and upheaval of separating 2,300 kids from their parents, but the shift brought fresh confusion of its own.

A volunteer pediatrician applies cream to scratches on 3-year-old Juan, a child migrant from rural Guatemala, in El Paso, Texas. Hannah Rappleye / NBC News

Overwhelmed courts dismissed cases. Migrants who had been apprehended as the order went into place still faced immigration proceedings, but avoided being separated. In the chaos, the numbers arriving quickly outstripped the capacity to detain families together. Agencies at the border began to process and release families with ankle monitors, much as they had before "zero-tolerance" went into effect.

Mothers, fathers and children boarded buses and planes to reunite with friends and family while their cases work their way through the system, which can take years.

Micaela and the two other women she was traveling with were among the migrants who, because of an accident of timing, avoided family separation, family detention and criminal prosecution. On Friday, they arrived at the office of Cynthia Lopez, an immigration attorney and part of a network of El Paso volunteers who are helping migrant families. Lopez's staff had gathered donated items, like diapers and coloring books, and planned to shuttle the women and children to the Greyhound station later that evening. They would board buses bound for Alabama.

Six-month-old Alan Ivan is examined by a volunteer pediatrician. This week, he and his mother traveled from Guatemala to El Paso and were allowed to stay in the U.S. Hannah Rappleye / NBC News

Among the three indigenous women from the Guatemalan highlands, where many only speak Mayan languages, Maria Salazar, 23, was the sole mother fluent in Spanish. She said the women were coming to work, and to have a better life. "There, we have no money, no land to work," Salazar said.

Eight days before she was apprehended, she and her 3-year-old son Miguel left their home. They took buses through Mexico. When they arrived in Ciudad Juarez on Tuesday, they began to walk. They crossed under an international bridge into El Paso. The Border Patrol found them moments after they reached Texas. Agents took them to one holding center, then another.

"There were many women with children, and men as well — a thousand, I think, maybe more," said Salazar. She said they slept 13 to a cell. "There on the floor, without blankets. It was very cold."

Juan, 3, cries as a volunteer pediatrician examines him. Juan arrived in the U.S. with his mother and sister after traveling many days by bus through Mexico. Hannah Rappleye / NBC News

From there officials took them to a processing center, where they were fitted with ankle monitors. The following day, they were taken by bus to a shelter at a local church, which gave them some fresh clothes and helped them contact family and friends.

A few hours before the women left El Paso, a volunteer doctor examined the tired children to make sure they were healthy. Three-year-old Juan perked up when one of the volunteers offered him a bright green ice pop.

As Dr. Ittay Moreno peeled off Juan's shirt, the boy began to cry. His mother calmed him, speaking in Q'anjob'al, their Mayan language. Angry scratches marked his narrow back, mementos of scrambling through the brush at the border. A volunteer distracted Juan with a cookie as Moreno rubbed ointment on his raw skin.

Micaela's son, Alan Ivan, was the last child in line. Moreno checked his eyes, took his temperature, and gently placed him on a scale covered by a blue towel. The baby fussed in the few moments he was left alone. "Sorry, little dude," Moreno said as he picked him up.

Moreno told the mothers that despite being tired, and slightly underweight, the children were, overall, healthy. He gave them cream for the bug bites that dotted their arms and chests.

Then a volunteer gathered the women together and tried to explain the next leg of their trip. First they would go to Dallas, and from there, transfer to another bus. In Alabama, Micaela would have to catch a third bus to reach the town where her husband and her 2-year-old daughter waited for them. Her ankle monitor would track her all the way, so Immigration and Customs Enforcement (ICE) could find her when her court date arrived.