A young Hispanic activist who lived most of his life in San Antonio gave up a court challenge against the U.S. government Friday, opting to be deported rather than remain in jail while a long legal fight loomed.

Sergio “Mapache” Salazar was born in Mexico but had been living here legally under a program known as DACA that allows some immigrants to defer deportation.

He withdrew his intent to seek voluntary departure and instead agreed to the removal order by an immigration judge.

“After discussing it with my attorneys, that is what’s best for me, unfortunately,” Salazar told Immigration Judge Justin Adams. Salazar appeared at Friday’s hearing via video from a Laredo jail.

Salazar, 18, could be deported within the next week. He plans to live with a grandmother in Monterrey, Mexico, his lawyers said.

RELATED: Immigrant GI booted out of Army at Fort Sam

Salazar has lived in the U.S. since his parents brought him here when he was 2. He had been living legally as a recipient of temporary legal immigration status under the DACA program.

He is a graduate of Roosevelt High School and aspires to make films, according to the advocacy organization Refugee and Immigrant Center for Education and Legal Services, or RAICES.

RAICES had filed for a renewal of his DACA status, but it was denied this summer. Salazar was arrested Aug. 3 as federal agents moved to deport him. He had left a camp outside of an office of U.S. Immigration and Customs Enforcement on the North Side, where he and others had been protesting ICE.

He has been in jail for more than a month as ICE lawyers filed paperwork alleging he is a national security risk because of social media postings reportedly threatening law enforcement.

Salazar denies making threats.

Salazar’s lawyers, immigration attorney Javier Maldonado and Cristian Sanchez with RAICES, said a number of things went into the decision to change course from last week, when Salazar initially sought to seek to leave voluntarily.

“He’s a young kid. As an 18- 19-year-old, he’s scared,” Maldonado said. He added that a decision on Salazar’s voluntary departure might not have come Friday. Even if Salazar won, the government could appeal, leaving him in jail until an appellate immigration court ruled.

“What it came down to is with voluntary departure, if it was denied, a finding of national security risk might go on his record,” Sanchez added. Such a finding might affect Salazar’s chances to ever return legally to the U.S.

“The tool they use is to hold them in jail for weeks (so) that it becomes too much to bear,” Sanchez said. “For an 18-year-old who never hurt anyone or isn’t violent, that was too much. … They targeted him because he protested against ICE. They put him in a no-win situation.”

ICE responded that it “does not target unlawfully present immigrants for arrest based on advocacy positions they hold or in retaliation for critical comments they make.”

“Any suggestion to the contrary is irresponsible, speculative and inaccurate,” the agency said. “ICE prioritizes its enforcement resources on individuals who pose a threat to national security, public safety and border security.”

Lawyers for ICE last week told the judge they had planned to use evidence that included screen grabs from what they contend was Salazar’s Twitter account to show why they consider Salazar a safety threat.

The FBI had obtained a search warrant for the tweets, which were never made public. He was never charged criminally.

Guillermo Contreras covers federal court and immigration news in the San Antonio and Bexar County area. Read him on our free site, mySA.com, and on our subscriber site, ExpressNews.com. | gcontreras@express-news.net | Twitter: @gmaninfedland