A federal judge dismissed a lawsuit on Friday challenging Massachusetts's ban on assault weapons.

U.S. District Judge William Young said in his ruling that the firearms and large magazines banned by the state in 1998 are “not within the scope of the personal right to ‘bear Arms’ under the Second Amendment.”

ADVERTISEMENT

The features of a military-style rifle are "designed and intended to be particularly suitable for combat rather than sporting applications," Young wrote.

Massachusetts was within its rights since the ban passed directly through elected representatives, Young decided.

“Other states are equally free to leave them unregulated and available to their law-abiding citizens,” Young wrote. “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.”

The lawsuit was filed last year by the Gun Owners Action League of Massachusetts, who claimed the law infringed on their Second Amendment rights.

Attorney General Maura Healey (D), a defendant in the suit, said the ban “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 said in a Facebook statement. “Families across the nation should take heart in this victory.”

In a statement, the National Rifle Association (NRA) blasted the decision.

“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 group said.

State laws on firearms have been under increased scrutiny since the Parkland, Fla., school shooting in February, which left 17 dead.

After the shooting, Florida Gov. Rick Scott (R) signed new restrictions raising the age limit for gun purchases from 18 to 21 and imposing a three-day waiting period for the sale of most long guns. The NRA promptly filed a lawsuit against the Florida law.

Massachusetts Gov. Charlie Baker (R) said in the aftermath of the Feb. 14 mass shooting at Marjory Stoneman Douglas High School that he would support a federal ban on assault-style weapons.

—Updated at 6:08 p.m.