BOSTON (AP) — Assault weapons and large-capacity magazines are not protected by the Second Amendment, a federal judge said in a ruling Friday upholding Massachusetts’ ban on the weapons.

U.S. District Judge William Young dismissed a lawsuit challenging the 20-year-old ban, saying assault weapons are military firearms that fall beyond the reach of the constitutional right to “bear arms.”

READ MORE: Boston Marathon Runner, Children's Hospital Patient Partner Build Special Bond

Regulation of the weapons is a matter of policy, not for the courts, he said.

“Other states are equally free to leave them unregulated and available to their law-abiding citizens,” Young said. “These policy matters are simply not of constitutional moment. Americans are not afraid of bumptious, raucous and robust debate about these matters. We call it democracy.”

State Attorney General Maura Healey said the ruling “vindicates the right of the people of Massachusetts to protect themselves from these weapons of war.”

“Strong gun laws save lives, and we will not be intimidated by the gun lobby in our efforts to end the sale of assault weapons and protect our communities and schools,” Healey, a Democrat, said in a statement. “Families across the country should take heart in this victory.”

AR-15 assault-style rifles are under increased scrutiny because of their use in several recent mass shootings, including the February massacre at a Florida high school that left 17 people dead.

The Gun Owners Gun Owners’ Action League of Massachusetts and other groups that filed the lawsuit argued that the AR-15 cannot be considered a “military weapon” because it cannot fire in fully automatic mode.

But Young dismissed that argument, noting that the semi-automatic AR-15’s design is based on guns “that were first manufactured for military purposes” and that the AR-15 is “common and well-known in the military.”

“The AR-15 and its analogs, along with large capacity magazines, are simply not weapons within the original meaning of the individual constitutional right to ‘bear arms,'” Young wrote.

Young also upheld Healey’s 2016 enforcement notice to gun sellers and manufacturers clarifying what constitutes a “copy” or “duplicate” weapon under the state’s 1998 assault weapon ban, including copies of the Colt AR-15 and the Kalashnikov AK-47.

Healey’s stepped-up enforcement followed the shooting rampage at a nightclub in Orlando, Florida, that killed 49 patrons. She said at the time that gun manufacturers were circumventing Massachusetts’ ban by selling copycat versions of the weapons they claimed complied with the law.

READ MORE: 'Now Is The Time To Get Us Home,' Those Who Served In Afghanistan Say It's Time To Go

The Massachusetts assault weapons ban mirrors the federal ban that expired in 2004. It prohibits the sale of specific and name-brand weapons and explicitly bans copies or duplicates of those weapons.

Jim Wallace, executive director of the Massachusetts gun owners group, said Young’s upholding of Healey’s crackdown on copycat assault weapons gives the attorney general “unbridled authority” to interpret laws as she pleases.

“Everyone in the state should be really concerned about that,” Wallace said. “What if the next attorney general isn’t a friend on one of your issues?”

Wallace said he couldn’t yet say whether the group will appeal the ruling.

In a statement, The National Rifle Association’s Institute for Legislative Action called the ruling disappointing.

“Like all law-abiding Massachusetts gun owners, the NRA was extremely disappointed that the court upheld Massachusetts’s ban on many of the most popular firearms in America,” the statement said. “Even more disturbing was Judge Young’s assessment that the  ‘AR-15’s present day popularity is not constitutionally material’ and that ‘Justice  Scalia would be proud’ of this ruling.”

“It is outrageous that Judge Young is taking advantage of the fact that Justice Scalia is unable to refute such a claim,” the statement said. “Justice Scalia’s position on the question of whether the AR-15 is protected by the Second Amendment is clear. In the 2015 Friedman v. City of Highland Park case, Justice Scalia joined a dissent which stated that the decision by millions of Americans to own AR-style rifles for lawful purposes ‘is all that is needed for citizens to have a right under the Second Amendment to keep such weapons.’”

“As long as politicians and judicial officials continue to flout the law in order to advance a political agenda, the five million members of the NRA will be here to hold them accountable,” the statement said.

The U.S. Supreme Court has ruled that the Second Amendment of the U.S. Constitution allows Americans to have guns in their homes for self-defense, blocking local governments from banning handguns.

But the court last year turned away an appeal from Maryland gun owners who challenged the state’s ban on assault weapons.

MORE NEWS: NH Youth Baseball Team Forced To Cancel Trip To Cooperstown Over 12+ COVID Vaccine Requirement

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)