This story also appears at Documented, a non-profit news site devoted solely to covering New York City’s immigrants and the policies that affect their lives. Subscribe to their newsletter here.

From the moment Mahmoud* was detained at the border, he told federal authorities he was 17 years old.

He told them at the Border Patrol station. He told them at the Immigration and Customs Enforcement adult detention facility where he was held in Port Isabel, Texas.

“They asked me for documents that prove I’m 17 years old and I provided all those documents,” he told Judge Frank Pimentel in the Port Isabel, Texas immigration court.

“I’m assuming the government must have some basis for concluding that he is older than that,” Pimentel responded.

The attorney for Immigration and Customs Enforcement told the judge the birth year they had would make Mahmoud 25 years old. “I’m sure [ICE deportation officers] would have looked into that already,” the ICE attorney said. ICE spent the next four months fighting to keep him in adult detention.

Two years later, Mahmoud can hardly speak about the experience. “ It was hard for me in there,” he said.

In detention, he could barely sleep and often woke up crying.

“He wasn’t able to be his young self in detention,” said Carina Patritti, an attorney at the Legal Aid Society who has represented Mahmoud. “He had to grow up quickly.”

Mahmoud says he gave ICE and CBP agents a copy of his birth certificate immediately after he was detained at the border. He fled his home country in West Africa at age 17 after the government targeted him due to his political participation. He quickly gathered some documents and clothing and flew to Brazil. From there, he traveled up to the US-Mexico border and crossed with a group of men from his country.

Border Patrol agents found the group and arrested them. In the station, the agents put Mahmoud in a room with a French-speaking translator on speakerphone, he said. The agents asked Mahmoud about his age. He presented them with a copy of his birth certificate and a few other documents and spent the night at the station.

“They continued to ask me. I told them again, I am 17,” he said in an interview. Eventually they hurried him into a van and drove him to the Port Isabel Detention Center, a detention facility for adults. Mahmoud says he told ICE and CBP agents repeatedly that he was 17 years old throughout his detention.

Under the Flores settlement, a lawsuit from 1997, the U.S. government is only allowed to detain people under the age of 18 for 20 days, and only in facilities with higher standards of care than adult immigration detention centers. Mahmoud was held for about four months in a privately run facility for adults.

Asylum seekers often flee in haste, grabbing what documents or valuables they can find before pushing towards the U.S.. Federal agents scrutinize their documents to spot fakes and catch people trying to game the system. Various branches of the Department of Homeland Security have entire units dedicated to detecting fraudulent documents. This scrutiny is partially due to the fact that minors are allotted more chances to file for asylum and have more freedoms in captivity.

“Since 1997, there have been numerous developments affecting DHS’s and ORR’s age determinations, but there remains no real procedure by which conflicting evidence regarding age may be weighed by a neutral and detached decision maker,” said Carlos Holguín, general counsel at the Center for Human Rights & Constitutional Law, the civil-rights legal organization that brought the Flores case to court. Federal policy dictates that if a “reasonable person” would conclude that an immigrant detained by ICE is an adult, despite their claims to be a minor, then the government will “treat the person as an adult for all purposes.”

ICE didn’t respond to a request for comment.

In a court hearing, Mahmoud said that while traveling with a group of migrants through Panama, they had been stopped by border agents. “They were taking all the minors, keeping them and asking them questions,” he told Judge Pimentel, so he’d said that he was 25.

“All right, well again, I don’t know anything about that. What we have to do now is to schedule your case for a hearing,” Pimentel responded.

In a later hearing, the judge pushed back against ICE’s claims about Mahmoud’s age. “I respect the fact that [ICE agents are] making immediate type decisions and don’t always have the information at hand at the time. But the court is not going to base its determination of the respondents age on how the respondent looks to the court,” Pimentel said. He asked the ICE attorney to produce evidence to support their claim that Mahmoud was older than he said he was.

The ICE attorney said that they reached out to the government of his home country—which Mahmoud was fleeing—to verify his birth certificate was genuine. They hadn’t received a response yet, but the Department of Homeland Security’s position on his age remained that Mahmoud “is not a juvenile and we would like to proceed as such,” the attorney said.

Judge Pimentel asked the ICE attorney for more evidence to support their claim about his age and postponed the hearing for about two weeks. Mahmoud was silent during the exchange.

The judge later added, “At some point, if I don’t get any answer, then we’ll be here until the summertime when at your claim, you turn 18, and then it won’t be an issue anymore.”

Denise Slavin, a retired immigration judge, explained that immigration judges—who are employees of the Department of Justice, rather than part of the independent judicial branch of the government—don’t have jurisdiction over where detainees are held. “They can tell them what court their case will be in but not where they’re held,” she said.

After the hearing, ICE agents took Mahmoud to get a dental examination to prove his age. The exam showed he was likely 16 to 22 years old, according to the court recordings. ICE released him to the custody of the Office of Refugee Resettlement, which oversees unaccompanied minors, about four months after he entered the Texas facility. Mahmoud was transferred to a facility in Chicago where he was finally able to call his father. There, he saw a counselor three times per week and was able to go outside. “I had no one in detention,” he said.

Mahmoud was released from ORR custody and was allowed to move in with his cousin in the Bronx. His case was transferred to the New York City immigration court, where he was able to find a lawyer, and together they’re fighting for his asylum claim. He is enrolled at a high school in the Bronx for 10th grade and wants to go to college to become an accountant.

“The only thing that makes me happy is to think about my opportunity to study here,” he said. “No one can stop me to study here, not like in my country.”

Sometimes thoughts of his journey and imprisonment creep back into his mind. But he doesn’t talk about his experiences with any of his friends or at home; he just tries to forget.

*This story uses a pseudonym to protect the subject’s identity.