WASHINGTON ― A federal appeals court ruled on Tuesday that a Maryland ban on assault-style rifles and large-capacity magazines isn’t subject to the Constitution’s right to keep and bear arms.

The full U.S. Court of Appeals for the 4th Circuit in Richmond, Virginia, reconsidered a divided ruling issued last year that found citizens have a “fundamental right” to own these weapons, and that laws restricting the right deserve the toughest level of constitutional scrutiny.

Writing for a nine-judge majority, U.S. Circuit Judge Robert King said that weapons such as M-16s and functionally equivalent guns that “are most useful in military service” aren’t protected by the Second Amendment as interpreted by the Supreme Court in the landmark District of Columbia v. Heller decision. That ruling limited the Second Amendment’s “core protection” to the ownership of handguns for purposes of self-defense within the home.

“Put simply,” King wrote, “we have no power to extend Second Amendment protection to the weapons of war that the Heller decision explicitly excluded from such coverage.”

The court separately rejected claims that Maryland’s assault weapons ban violated the 14th Amendment of the Constitution.

In 2013, then-Gov. Martin O’Malley (D) signed Maryland’s Firearm Safety Act in the wake of the massacre at Sandy Hook elementary school in Newtown, Connecticut. The 4th Circuit ruling begins by recounting this and other high-profile mass shootings ― including those in San Bernardino, California, and at the Pulse nightclub in Orlando, Florida.

The Maryland law, which imposes criminal penalties of up to three years in prison for violators, was challenged in federal court by two Maryland gun owners and a number of gun shops and gun rights’ groups.

In a separate opinion agreeing with the ruling, U.S. Circuit Judge J. Harvie Wilkinson wrote that legislatures are better equipped than courts to tackle the problem of gun control, and thus judges should be wary of “constitutionalizing” these legislative choices.

“To say in the wake of so many mass shootings in so many localities across this country that the people themselves are now to be rendered newly powerless, that all they can do is stand by and watch as federal courts design their destiny ― this would deliver a body blow to democracy as we have known it since the very founding of this nation,” Wilkinson wrote.

Four judges dissented from the ruling, which they said effectively allows “the Government ... to take semiautomatic rifles away from law-abiding American citizens.”

“In concluding that the Second Amendment does not even apply, the majority has gone to greater lengths than any other court to eviscerate the constitutionally guaranteed right to keep and bear arms,” wrote U.S. Circuit Judge William Traxler.

If appealed, at least four justices on the Supreme Court would need to agree to review the ruling. Neil Gorsuch, President Donald Trump’s nominee to fill the court’s vacancy, lacks a clear record on gun rights, but received a ringing endorsement from the National Rifle Association.

In recent years, the high court has been reluctant to clarify if the scope of the Second Amendment protections it announced in the Heller decision should be expanded beyond handguns, or to contexts that do not involve protecting one’s home.

In June, the court declined to review a challenge to a similar assault weapons ban enacted in Connecticut in the wake of the Sandy Hook massacre.

Language has been added to further explain the 4th Circuit’s decision.