Semi-automatic pistols for sale.
CNN  — 

Federal regulations setting a minimum age of 21 years old for purchasing handguns from licensed dealers violate the Second Amendment, a federal appeals court ruled Tuesday.

The restrictions were deemed unconstitutional by a divided three-judge panel of the 4th US Circuit Court of Appeals. The majority opinion, written by Donald Trump-appointee Judge Julius N. Richardson, said the laws relegated “either the Second Amendment or 18- to 20-year-olds to a second-class status.”

“Looking through this historical lens to the text and structure of the Constitution reveals that 18- to 20-year-olds have Second Amendment rights,” he wrote. “Virtually every other constitutional right applies whatever the age. And the Second Amendment is no different.”

Richardson was joined by Judge G. Steven Agee, who was appointed by George W. Bush.

RELATED: The Supreme Court’s conservatives may have the votes to expand Second Amendment rights

Judge James A. Wynn Jr., a Barack Obama appointee, dissented. He accused the panel majority of granting “the gun lobby a victory in a fight it lost on Capitol Hill more than fifty years ago,” and said the ruling was not “consistent with the proper role of the federal judiciary in our democratic system.”

The ruling is the latest example of how the federal judiciary has moved rightwards, particularly with the mark former Trump was able to leave on the bench. It is expected that Tuesday’s decision will be appealed, and could eventually land before the Supreme Court, which already has another gun rights case before it in the coming term. That case, for which oral arguments have not yet been scheduled, deals with the restrictions New York imposes on carrying firearms in public.

The gun control rules in the 4th Circuit case were challenged in court by prospective gun buyers who were blocked from purchasing handguns due to the federal age minimum. Their lawsuit targeted several restrictions Congress passed with a 1968 law, as well as related regulations, that ban gun dealers from selling handguns to those under 21. At the time, lawmakers cited research showing that those under 21 were involved in crime and gun violence at disproportionately high rates.

But the 4th Circuit majority, in its opinion on Tuesday, said that “the rights of more than 99% of a group cannot be restricted because a fraction of 1% commit a disproportionate amount of violent crime.”

The opinion also discussed on the prevalence of requirements that those 18 and older server in state militias at the time of the Second Amendment’s ratification in 1791.

“Militia laws are helpful because they provide a baseline for determining the relevant political community that enjoyed Second Amendment rights,” Richardson wrote. “They support the affirmative conclusion that 18-year-olds are protected by the Second Amendment. But even if history were less clear, 18-year-olds would not necessarily be excluded from the Second Amendment’s protections.”

Future of gun laws

Other courts had previously upheld the federal age minimums, as well as more expansive age limits that have been passed by states. Just last month, a federal judge upheld Florida’s ban on firearm sales to those under 21.

Tuesday’s 4th Circuit decision was “surprising, in part, because this law has been upheld previously by courts,” said Adam Winkler, a University of California-Los Angeles law professor and author of “Gunfight: The Battle Over the Right to Bear Arms in America.” But the decision was “not a shock,” Winkler added, given the focus on gun rights during Trump’s judicial push.

“I think we are going to see a lot of these gun laws called into question in coming years as a result of those Trump appointments,” he said.

The Justice Department did not immediately return CNN’s request for comment.

But legal experts told CNN they expected the DOJ to appeal the case and ask for the full 4th Circuit to review the decision. Whether the case will end up before the Supreme Court is less certain, given the small fraction of cases appealed to it that the high court hears each year.

According to David Kopel, an adjunct scholar at the libertarian Cato Institute, the likelihood the Supreme Court getting involved in the case increases if Tuesday’s decision is allowed to stand.

“One of the things the Supreme Court pays attention to is when a federal statute is struck down as unconstitutional,” he said.

This story has been updated with additional details Tuesday.