"I'm so thankful Francisco is free and he can sleep at home tonight and see his mom," his attorney Claudia Galan told the AP.

But he was taken into custody anyway, spending weeks in a CBP detention center before being moved over the weekend to an Immigration and Customs Enforcement facility, where he was finally allowed to call his family, the AP reported. On Tuesday, he was released from ICE custody.

Francisco Erwin Galicia was stopped at a Customs and Border Protection checkpoint on June 27 as he, his younger brother, and others were traveling from the border town of Edinburg, Texas, to Ranger College for a soccer scouting event, the Dallas Morning News reported . Galicia provided Border Patrol officers with his Texas ID card — which is only issued to residents who can prove they are a citizen or legal resident. He also showed his social security card and birth certificate, the Associated Press reported .

An 18-year-old American citizen who was born in Dallas was released on Tuesday after being held in immigration detention for more than three weeks, despite showing his ID and birth certificate to border agents.

Galan had provided immigration authorities with a copy of Galicia's birth certificate, which showed he was born in a Dallas hospital in December 2000. But authorities pointed to a conflicting document that claimed Galicia was born in Mexico.

When he was a child, Galicia's mother, who is not living in the US legally, took out a tourist visa for her son, listing his birthplace as Mexico, so he could cross the border and visit relatives, the AP reported. She was unable to get a US passport for the boy because her name didn't match how she had identified herself on his birth certificate, Galan said.



She explained that mistake to immigration officials and provided other documentation that Galicia was, in fact, a US citizen, Galan said.

On Tuesday afternoon, after 26 days in custody, authorities agreed those documents were valid and released Galicia. A joint statement by ICE and CBP noted that Galicia had provided conflicting reports about his citizenship.

"Situations including conflicting reports from the individual and multiple birth certificates can, and should, take more time to verify," the statement said. "While we continue to research the facts of the situation, the individual has been released from ICE custody. Both CBP and ICE are committed to the fair treatment of migrants in our custody and continue to take appropriate steps to verify all facts of this situation.”

Galicia's brother, 17-year-old Marlon Galicia, was also detained at the checkpoint on June 27 and taken into custody. Unlike his older brother, he was born in Mexico and did not have legal authorization to live in the US. After two days in custody, the teen signed a voluntary deportation order and is now staying with his grandmother in Mexico, the Morning News reported.