(CNN) He served in the US military for six years. But the toughest battle Hector Barajas faced lasted more than a decade.

Barajas was deported in 2004. On Friday, he became a US citizen at a ceremony in San Diego after California's governor cleared the way for his return.

Barajas has become a well-known leader of an increasingly vocal group of deported veterans, many of whom have made their home across the US-Mexico border in Tijuana.

Whether the US government should deport people who've served the country is a debate that sits at the intersection of two major areas in US politics: immigration and the military.

So how did we get here? Let's take a step back and look at some of the issues at play:

There are immigrants in the US military?

Yes, tens of thousands of them in fact. About 40,000 immigrants serve in the armed forces, according to a report from the National Immigration Forum . Most of them are lawful permanent residents of the United States. And more than half a million US veterans are foreign-born.

Deported veteran Hector Barajas still wears the medals he earned serving in the US military.

Is this a new thing?

Not at all. There's a long history of immigrants serving in the military. During the Civil War, about 20% of the Union Army's 1.5 million members were foreign-born, according to the Migration Policy Institute . And immigrants made up more than 18% of the US Army during World War I, according to US Citizenship and Immigration Services . Some units had so many foreign-born soldiers that they became known for their immigrant members, including the 77th Infantry Division, which was known as the "Melting Pot Division."

So how does a veteran end up getting deported?

Each case is different. But they generally share one thing in common: They were honorably discharged from the military but later convicted of crimes after returning to civilian life.

Barajas, who was born in Mexico and brought to the United States as a child, served in the 82nd Airborne Division from 1995 until he was honorably discharged 2001.

Soon afterward, he was arrested over shooting a gun from his vehicle. Nobody was hurt, but he was charged with assault and pleaded no contest in 2002 to a charge of shooting at an occupied vehicle

Authorities revoked his green card and deported him after he served a two-year prison sentence. He's been living in Tijuana and trying to get back to the United States ever since.

And he's not the only one. Barajas founded a safe house in Tijuana for other deported veterans. Dozens have passed through "The Bunker," seeking shelter and trying to get back on their feet.

"I want to apologize once more for what got me deported. I'm not proud of the circumstances that led to it," Barajas said at a news conference after Friday's citizenship ceremony. "But I am proud of my service and the work that I'm doing today."

Once they're deported, what options do they have?

It's a long road. Many struggle to find jobs in countries they barely know, Barajas says.

Just last month, CNN followed the case of another veteran who's just beginning the journey . Miguel Perez Jr., who served more than seven years in prison after a felony drug conviction, was deported in March after a legal battle. But he says he's not done fighting.

"I will continue to struggle, not only for myself, but for other veterans and others who have been separated from their families," he said.

JUST WATCHED Deported vet: I would still die for the US Replay More Videos ... MUST WATCH Deported vet: I would still die for the US 01:32

Barajas has said he didn't apply for citizenship while in the Army because he assumed military service guaranteed it. Many other deported veterans, he says, thought the same thing.

It's unclear how many veterans have been deported; officials don't track that figure. In 2016, an official with the American Civil Liberties Union told CNN the organization had connected with 70 deported veterans scattered all over the world. On Friday, the ACLU said Barajas is the first known deported veteran to be naturalized as a US citizen.

It took years for Barajas to get back on a path to citizenship. Last year, California Gov. Jerry Brown pardoned him, paving the way for Barajas to return to the United States.

Over the years there's been legislation proposed to help bring deported veterans back to the United States, but it hasn't gained enough support to pass.

How are things changing under the Trump administration?

• Lawful permanent residents now have to complete background screenings before they're allowed to begin active, reserve or guard service. Before, they were able to ship to initial military training if background checks had started.

• Foreign nationals now have to serve at least 180 consecutive days of active duty service or complete a year of reserve service to be eligible for expedited naturalization . Previously, they were eligible after one day of service.

What about DACA recipients in the military? Should they worry about being deported?

The Deferred Action for Childhood Arrivals program gave deportation protection to more than 700,000 young undocumented immigrants who came to the United States as children. And hundreds of them enlisted in the military.

JUST WATCHED Military DACA recipients await their fate Replay More Videos ... MUST WATCH Military DACA recipients await their fate 04:15

Now that he's a citizen, what's next for Barajas?

For a year, he plans to keep living in Tijuana and making sure his Deported Veterans Support House will stay afloat. Then he'll return to the United States.

"My dream is to put my daughter through college, find a job, continue to help others, maybe go to college," he said. "But my biggest dream is to see all my brothers and sisters go home to the country they're willing to die for."

On Friday, Barajas said he was looking forward to spending time with his family north of the border.

But, he said, there's one thing he intends to do first: register to vote.