DALLAS, Texas — A Dallas-born teenager who was wrongfully detained in a border detention center for nearly a month now plans to take the federal government to court, his attorney said Wednesday. 

Francisco Erwin Galicia's story has spread across Texas. The 18-year-old told WFAA that what's happened to him is an "injustice."

RELATED: Teen born in Dallas and mistaken as an undocumented immigrant released from federal custody

On June 27, Galicia and four other friends (including his brother Marlon Galicia) started driving from Edinburg to Ranger College because Galicia and his brother planned to try out for the school's soccer team. 

Galicia was born at Parkland Memorial Hospital but now lives in Edinburg with his family. 

When the car was stopped at a U.S. Border Patrol checkpoint in Falfurrias, Galicia and his brother were separated. Galicia's brother is undocumented. 

Yet, Galicia said he had his Texas driver's license, social security card and a wallet copy of his birth certificate. 

However, Galicia ended up being detained because court documents show that federal agents thought his documentation was fake. 

In federal removal papers, it reads in part, "...you falsely represented yourself to be a citizen of the United States." 

The papers also said, "You are a native of MEXICO and a citizen of MEXICO." 

Galicia said that federal agents wouldn't believe him no matter how much he tried to communicate that he was a citizen. 

"They thought they were fake," Galicia said. "I had all my papers, but they still didn't believe me. I don't know the reason why." 

For weeks, Galicia was detained in a border detention center near Falfurrias. 

Horror stories have surfaced from such centers, and Galicia said his time there was no different. 

The 18-year-old said that he lost at least 20 pounds in weight. 

"There were up to 70 people in a room," Galicia said. "They wouldn't let us brush our teeth or go to the bathroom. There were people who were very sick inside, and it's really inhumane the way we were treated."

Galicia even said that he almost volunteered to be deported because the conditions were so bad. 

"I didn't want to suffer anymore. I was at a breaking point," Galicia said. 

Galicia's mother eventually called immigration attorney Claudia Galan to get involved. 

Galan told WFAA that she took Galicia's birth certificate and other identification documents to the center the teen was being housed inside two weeks ago, but that she didn't get any traction about a release until she went to the media.

Her biggest fear was that Galicia would be deported. 

After the teen's story started spreading, he was eventually released from a federal facility on Tuesday in Pearsall after being transported there last week. 

"Their job is to deport people. Their practice is to be tough," Galan said. "But they should have looked into his claim from day one. They had the documents." 

Galicia was detained for 23 days. 

How did this happen?

WFAA reached out to U.S. Immigration and Customs Enforcement along with the U.S. Border Patrol about Galicia's detainment. 

Both agencies sent out a joint statement Tuesday. 

“This individual provided conflicting reports regarding status of citizenship after being apprehended by U.S. Border Patrol and transferred into Immigration and Customs Enforcement Custody. Situations including conflicting reports from the individual and multiple birth certificates can, and should, take more time to verify. 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.”

Galan hopes to challenge that statement in court. She and Galicia plan to file a Bivens action against CBP and ICE. 

A Bivens action is a lawsuit for damages when a federal officer allegedly violates the U.S. Constitution.

Galan thinks it's likely that federal agents may have held Galicia because he had a visitation visa as a minor. 

She said Galicia's mother was unable to obtain a passport for the teen and claimed he was born in Mexico to get a visa so that he could travel to visit family. 

Yet, Galan said that all should not have mattered. The birth certificate, social security information, and license should have been an easy giveaway. 

Instead, she thinks federal agents profiled him. 

"Francisco's English is not good. So they probably thought, if he was a U.S. citizen he should be able to speak English. 

"They also probably thought that because he's with other undocumented immigrants that he was one too." 

Galan said she plans to file the suit in the coming weeks. 

MORE on WFAA: