Daniel Torres was an undocumented immigrant when he used a false US birth certificate to join the marine corps. After serving in Iraq, he was found out and discharged. Eventually he returned to Tijuana, where he was born, though he said he was always homesick for the country he had fought for.

But on Thursday, in San Diego, the 30-year-old veteran was sworn in as a US citizen.

ADVERTISEMENT

“I still can’t believe it,” he said. “It’s a big relief for me to be able to finally say on paper that I’m now protected. Now the law is on my side.”

Related: Obama’s immigration action prompts heated exchanges at supreme court

Torres qualified for citizenship under a provision of the Immigration and Nationality Act that allows immigrants to naturalize if they served in the US military during a period of hostility. The provision also waives other requirements to naturalize, including being a lawful permanent resident and being physically present in the United States.

He was 15 years old when he and his family moved to Idaho from Mexico, after his father obtained a work permit. The family stayed after the work permit expired and became undocumented.

He said he lied to a marine corps recruiter in 2007 about his immigration status – presenting a false birth certificate – because it was the only way he could enlist.

ADVERTISEMENT

“I wanted to be able to say that I’d done something for this country,” Torres said. “I wanted to show that I wasn’t an immigrant taking away jobs. I wanted to earn my place in the United States.”

The lie worked, but it caught up to him three years after he enlisted.

Torres had just returned from Iraq and was training to deploy to Afghanistan when he lost his wallet. In the middle of trying to replace his identification cards, the military found out about the false birth certificate. Authorities didn’t press charges and he was honorably discharged thanks to his reputation and record in the marine corps.

ADVERTISEMENT

At first, Torres, then 25, stayed in the US, trying to make a living. But he was still undocumented and his options were limited. He couldn’t work or pay for college, so he decided to seek opportunities elsewhere.

He went to France and tried to enlist in the French Foreign Legion. He was rejected because of a hearing loss he suffered while serving in Iraq. Then he decided to move back to Tijuana, Mexico, where he was born, and spent the next five years there. He began working at a call center and enrolled in college.

ADVERTISEMENT

“At the beginning, it was very exciting because I hadn’t seen my family in Tijuana for 10 years,” Torres said. “But once I settled down, I felt that I didn’t fit in with the Mexican culture and the way of thinking. I felt American.”

Last year, he became involved with the Deported Veterans Support House, a shelter in Tijuana, Mexico. That’s where he met Jennie Pasquarella, an attorney with the American Civil Liberties Union who helped Torres file his application for citizenship in late January.

On Wednesday, he received a visa to travel to San Diego so he could attend a hearing where it was determined he qualified for citizenship because of his military service. It was the first time in five years that he had set foot in the US. The next day, his citizenship application was approved, and he was sworn in a few hours later.

ADVERTISEMENT

“He’s gone from having no status in the United States to having complete status and being a full-fledged citizen,” Pasquarella said. “That’s quite special.”

Torres’ case is rare, if not unprecedented. Pasquarella said she was unaware of other undocumented veterans who had been able to return to the US and naturalize after having left the country.

Torres said he wanted to stay in Tijuana until he graduated from law school in December. After that, he plans to move to San Diego, where he’ll participate in a one-year program to validate his law degree.

Related: I am a ‘Dreamer’. I walked 1,500 miles for the right to stay in America | Carlos Roa

ADVERTISEMENT

He also plans to continue advocating so that more veterans, including those who’ve been deported, get to return home.

Hector Barajas, who runs the Deported Veterans Support House, said most of the veterans who’ve been deported were legal permanent residents who committed crimes that led to their deportations. Only a few were undocumented immigrants.

A bill introduced in Congress this week aims to help deported veterans return to the US but only if they were honorably discharged and have not been convicted of felonies or significant misdemeanors.

Pasquarella said the bill was “well-intentioned” but would leave out veterans who were deported for crimes they committed as they struggled to re-enter society following their military service.

ADVERTISEMENT

guardian.co.uk © Guardian News and Media 2016