An illegal immigrant charged with being an undocumented immigrant in possession of a weapon faces up to a decade in prison and possible deportation, but he's hoping that the Second Amendment can be his way to freedom, according to the New York Daily News.

Javier Perez fired a gun in the air in Brooklyn to scare away a rival gang in 2016. He has admitted as much, saying he borrowed the gun. But his lawyers are arguing that the Second Amendment voids the charge, because it doesn't specify that noncitizens don't have the right to bear arms.

"The Framers were clear: If they meant citizens, they would have said citizens," Perez's attorney Samuel Jacobsen argued in court Wednesday. "There is no suggestion that there was a concept of 'illegal alien' and no suggestion that if you were from a foreign country, you couldn't bear arms."

What's the basis of Perez's argument?

Perez's attorney is largely basing their argument on the 2008 Supreme Court decision District of Columbia v. Heller, which struck down a Washington, D.C., handgun ban.

Jacobsen argues that because the ruling says it's preemptively lawful to prevent mentally unstable people or felons from possessing guns, but doesn't say the same thing for illegal immigrants, that the Second Amendment must apply to Perez.

What do prosecutors say?

The prosecution argues that the state has a legitimate interest in preventing gun ownership for "those who are difficult to track, with no permanent address and who may have an interest in evading law enforcement." Specifically, illegal immigrants.

"They have an interest in not maintaining a stable residence or registering a firearm," Assistant U.S. Attorney Tanya Hajjar argued in court.

Hajjar also argued that three circuit courts have rejected similar arguments to Perez's, and two federal appeals courts have upheld the statute by saying it has reasonable public safety goals.

What will happen?

Since the Supreme Court has not explicitly addressed the issue of gun rights for noncitizens, this case is being allowed to move forward in court. Pratheepan Gulasekaram, a Santa Clara University law professor, said Perez may have a chance.

"The more one believes the Second Amendment is an individual right of self-defense, the harder it gets to say noncitizens are categorically not protected," Gulasekaram told the New York Daily News. "Any statute that makes firearms rights depend purely on immigrant status is constitutionally vulnerable."

(H/T The Daily Caller)