A mother and her 9-year-old daughter were separated for 36 hours after the child fell into U.S. Customs and Border Protection custody because agents at the border didn’t believe she was who she claimed to be, a mother says.

Thelma Galaxia said her friend, Michelle Cardenas, was driving each of their two children from Tijuana, where they live, to their schools in San Ysidro Monday morning, as they do nearly every day.

Galexia's 9-year-old daughter, Julia Isabel Amparo Medina, attends fourth grade at Nicoloff Elementary School and her 14-year-old son, Oscar Amparo Medina, attends ninth grade at San Ysidro High School. Both are passport-holding U.S. citizens.

When they got in line at the border at 4 a.m. Monday, traffic was moving slow. Cardenas told the four children to walk across the border instead. She was going to call them an Uber so they could make it to school on time.

But Oscar and Julia Medina never made it across, according to their mother.

Galaxia says CBP officers accused her daughter of lying about her identity. Officers told the girl she didn’t look like the girl in her passport card picture.

Julia Medina told NBC 7 that CBP officers accused her of being someone else, her cousin Melanie. The children said officers also accused Oscar Medina of smuggling and other crimes which he said he didn’t understand.

“My daughter told her brother that the officer told her that if she admitted that she was her cousin, she would be released soon so she could see her mom,” Galaxia said.

“I was scared. I was sad because I didn't have my mom or my brother. I was completely by myself,” Julia Medina said. She said she woke up several times throughout the night, sad because she wasn’t with her family.

Galaxia said officers made Oscar Medina sign a document that said his little sister was his cousin.

“That is not true,” Galaxia said. “She is my daughter. He was told that he would be taken to jail and they were going to charge him for human trafficking and sex trafficking.”

Oscar told NBC 7 he felt terrible for signing the document. He said he just wanted to see his sister.

When CBP officers told Galaxia that Oscar and Julia Medina were detained, she got the Mexican consulate involved.

At about 6 p.m., while Galaxia interviewed with NBC 7 in Kearny Mesa, the consulate called her and told her Julia Medina would be released to her at the San Ysidro Port of Entry.

Galaxia and her family rushed to the border where they were reunited with Julie almost two days later. The family of three hugged, cried and embraced, but Galaxia said the emotional reunion should never have had to happen.

NBC 7 reached out to CBP, asking why officers detained a 9-year-old U.S. citizen and kept her from her mother for 36 hours. The agency said it would respond to questions when it had more details on the case.

The Mexican consulate told NBC 7 it will also provide more information as to how they were able to reunite the family.