SAN FRANCISCO (KPIX 5) — It was an emotional reunion as an immigrant family, separated at the border, met again at San Francisco International Airport on Thursday afternoon.

Three-year-old Sophia was taken into custody by immigration officials at the border in June when the family attempted to cross the border from Mexico at an official border crossing, seeking asylum. It happened on the day that the Trump administration reversed its executive order to stop separating families at the border, but Sophia was taken anyway.

When they tearfully reunited, it was the first time that Sophia had seen her biological mother or grandmother in months.

RELATED: Immigrant Families To Be Reunited At Border In San Diego

KPIX 5 first met Sophia and her grandmother Angelica on the other side of the border with CBS reporter Mireya Villarreal.

“You are scared that they are going to separate you?” Villarreal asked Angelica.

“That is the reason you are not crossing; you are scared,” she realized.

But Angelica, who is Sophia’s legal guardian, had a change of heart the day President Trump reversed his decision to separate children from their families.

CBS News cameras followed Sophia and her grandmother across the border, who were no longer afraid of being separated. But a week later, their worst fears came true when Sophia was taken away.

“Sophia was pleading with her not to leave her alone, not to let her go, not to leave her with the police,” explained Villarreal, who was translating for Angelica.

Angelica said immigration officials took Sophia away anyway, citing a policy of continued separation for a small number of immigrant children when parental relationships could not be confirmed.

“These are papers that say you are the legal guardian, and they said that these don’t matter?” Villareal asked Angelica.

“Que no,” answered Angelica, nodding her head.

The documents weren’t important after all, Mireya said.

Luckily for Angelica and her family, the Annunciation House in El Paso, Texas, which provides shelter and legal assistance to immigrants, helped her along with more than 30 other immigrant parents who were separated from their children.

Like Angelica, most of the parents had no idea where their children were.

The family was reunited after 47 days. The separation was so agonizing that Angelica said she was hospitalized four days after losing her granddaughter.

Both Sophia’s mother and Angelica told KPIX 5 that they would not have crossed the border knowing what they know now. They said they would never have intentionally put little Sophia through this ordeal.