A United States citizen who was detained by U.S. immigration officials for nearly a month is being released, the law firm representing him confirmed to CBS News on Tuesday.

Francisco Erwin Galicia, 18, was born in Dallas in 2000, a birth certificate provided by his lawyer, Claudia Galan, shows. But he still had been held since by U.S. Customs and Border Protection (CBP) and then Immigration and Customs Enforcement (ICE) since June 27.

Galicia and his 17-year-old brother were traveling with friends from Edinburg, Texas, where they live, to Ranger College on June 27. They were visiting the school in for a soccer scouting event, the boys' mother, Sanjuana Galicia, told The Dallas Morning News.

Get Breaking News Delivered to Your Inbox

The brothers were detained at a CBP checkpoint in Falfurrias, Texas, Galan told the newspaper. Galicia's younger brother, Marlon, was born in Mexico and lacked legal status. Both boys, however, were taken to a detention center.

After two days in custody, Marlon signed a voluntary deportation form and is now in Mexico with his grandmother. He said he did it so he could speak to his mother.

Francisco Erwin Galicia was born in Dallas in 2000, a birth certificate provided by his lawyer, Claudia Galan, shows. He was detained by immigration officials on June 27. The Galicia Family

Meanwhile, inside the detention center, Francisco was unable to make phone calls for three weeks, his mother said. He has since been moved into ICE custody and was able to make a collect call to his mother on Saturday.

When they were first detained, Marlon had a school I.D. and his older brother was carrying his Texas state I.D. card, which can only be obtained with a Social Security number, according to the Dallas Morning News.

Galan told CBS News she then provided CBP and ICE with several documents proving her client is a U.S. citizen, including his birth certificate, his temporary I.D., health insurance cards and a high school school I.D.

Galan said earlier Tuesday she would be visiting the detention center on Tuesday to speak with his deportation officer.