Illegal aliens can now claim Second Amendment rights to own guns in violation of federal law, according to a federal appeals court that completely ignored the primary reason for the right to bear arms: to give Americans citizens the right to remove a tyrannical regime from power.

Mariano Meza-Rodriguez is an illegal alien from Mexico who was carrying ammunition for a .22-caliber firearm when he was arrested in 2013. He has been here since his parents brought him around age five. But federal law, found at 18 U.S.C. § 922(g)(5), makes it a crime for an illegal alien to have a gun. He was convicted, sentenced to time served, then deported to Mexico. He is appealing the federal district court’s decision not to dismiss his indictment that led to his conviction.

The Second Amendment provides that “the right of the people to keep and bear Arms, shall not be infringed.” In a seminal 2008 case, the Supreme Court held in District of Columbia v. Heller that the Second Amendment secures an individual right to keep and bear arms. On August 20, 2015, Chief Judge Diane Wood (a liberal appointee of Bill Clinton who was on Barack Obama’s short-list for the Supreme Court) wrote for a three-judge panel of the U.S. Court of Appeals for the Seventh Circuit that the panel could “see no principled way to carve out the Second Amendment and say that [illegal aliens] are excluded” from exercising Second Amendment rights.

The court’s opinion admitted, “some of Heller’s language does link Second Amendment rights with the notions of ‘law-abiding citizens’ and ‘members of the political community.’” But then the court incorrectly claims that Heller also “supports the opposite result: that all people, including non-U.S. citizens, whether or not they are authorized to be in the country, enjoy at least some rights under the Second Amendment.” The Seventh Circuit noted that three other federal appeals courts have said that illegal aliens do not have Second Amendment rights, but concluded that those courts were wrong, creating what lawyers call a “circuit split” by holding that § 922(g)(5) is unconstitutional.

But the court went on to sustain the indictment that led to Meza-Rodriguez’s conviction, with an analysis that’s bad news for gun owners. Chief Judge Wood wrote that while illegal aliens are entitled to Second Amendment rights, gun restrictions such as this one should only be subject to what courts call “intermediate scrutiny,” under which the court can uphold this statute, but also uphold a great many additional restrictions on the right to bear arms.

It’s true that the Supreme Court has noted that the term “the people” also shows up in the First and Fourth Amendments, and that Heller noted that gun rights were in some ways similar to free-speech rights. (In fact, I authored a legal scholarly work, “Making Second Amendment Law with First Amendment Rules,” published by Nebraska Law Review, that explains the relationship between these two parts of the Constitution’s Bill of Rights.)

But as the Seventh Circuit admitted, other uses of “the people” in the Constitution—such as Article I, Section 2’s provision that members of Congress shall be elected every two years “by the People of the several States,” and the Seventeenth Amendment’s provision that senators will be elected in each state “by the People thereof”—clearly refer only to voting citizens, though even then the court tries to maintain some wiggle room by saying this is only “likely.”

Even cases where the Supreme Court has interpreted “the people” differently do not support the Seventh Circuit’s interpretation. For example, in U.S. v. Verdugo-Urquidez, the High Court held that “the people” in the Bill of Rights includes only noncitizens who have “developed a sufficient connection with this country to be considered part of [the national] community,” such as permanent legal residents. The Court specifically contrasted the foreigner in that case from illegal aliens, saying that legal residents such as Mr. Verdugo-Urquidez “were in the United States voluntarily and had accepted some societal obligations.”

This panel could have chosen between two meanings of “the people”: one referring only to American citizens, and the other also including some (but not all) noncitizens. It freely chose to reject the argument that the right to bear arms is a special right that the Constitution promises to citizens eligible to vote. And the court also invoked one of the two wrongheaded decisions at the heart of the birthright citizenship immigration debate—Plyler v. Doe—where liberal Justice William Brennan slipped into a footnote in a 5-4 decision a nonbinding comment that states have no rational basis for treating legal aliens differently from illegal aliens.

The Chicago-based appeals court concluded, “No language in the Amendment supports such a conclusion, nor, as we have said, does a broader consideration of the Bill of Rights.”

The court is wrong. The Declaration of Independence says that in order to be legitimate, government must be by the consent of the governed, and that when the people of a nation withdraw their consent, the people have the right to “alter or abolish” that government.

The Constitution designed America’s democratic republican form of government to incorporate these principles. Adult citizens of this country have a fundamental right to vote, and this is the means by which citizens express their consent to be governed by certain people for a certain time. Then during the next election, those citizens again have the right to use their vote to withdraw their consent, and to alter their current government by electing new people.

As discussed in my law review article, the Supreme Court in Heller found that the reason the Second Amendment was written into the Constitution’s Bill of Rights was so that the American people could throw off a tyrannical regime that took power against the vote of the people, and held onto that power through military might. Justice Antonin Scalia wrote for the Supreme Court that “fear that the federal government would disarm the people in order to impose rule through [the military] was pervasive,” and that armed citizens “are better able to resist tyranny.” The right to remove from power such a regime is a power that the Constitution reserves to the voting citizens of this country, not to foreigners, and especially not to foreigners who are not even in this country legally.

This does not mean that foreigners should not be able to own firearms, as I explain both in my Nebraska Law Review work and also in another academic publication, “Citizen Gun Rights.” The Second Amendment secures a right to self-defense, and foreigners in this country—especially permanent lawful residents—have the same human concerns regarding their personal safety and the security of their families, homes, and businesses that any other human being might have. This simply means that Congress and state legislatures can decide when and how a foreigner in this country can have firearms, instead of it being a constitutional guarantee to be decreed by the courts.

The Seventh Circuit’s decision is manifestly wrong for other reasons as well. For one, it casts doubt on the legality of the federal law that says a person must be an adult to purchase a firearm from a store. Political rights—such as the right to vote or the right to serve on a jury—only apply to adult citizens. But personal rights—such as First Amendment rights to free speech or Fourth Amendment rights against unreasonable police searches—can also be claimed and exercised by children. A fourth-grade student has a First Amendment right to pray over her lunch at school or to tell her teacher that her favorite hero is Jesus, but only an insane person would suggest that fourth-grader has a constitutional right to buy a gun.

In conclusion, the Seventh Circuit’s decision is disturbing for two reasons. One, it diminishes the value of American citizenship and muddies the water in multiple areas of law and public policy by ignoring the vital distinction the Constitution makes between adult American citizens as opposed to foreigners (especially illegal aliens). And second, it degrades the Second Amendment into a right that can be regulated far more heavily—and thus carries much less force—than other fundamental rights.

The federal government cannot appeal this decision, because in the end it won its case by affirming the district court’s decision not to dismiss the case against Meza-Rodriguez. So unfortunately, unless this criminal asks the Supreme Court to review his case, this case will stay on the books for some time, working mischief to the Second Amendment rights of law-abiding American citizens.

Ken Klukowski is legal editor for Breitbart News and the author of both “Citizen Gun Rights” and “Making Second Amendment Law with First Amendment Rules.” Follow him on Twitter @kenklukowski.