(Yuri Gripas/Reuters)

The Supreme Court on Monday declined to review a Maryland law banning the sale of semiautomatic guns with certain military-style features, similar to weapons used in recent mass shootings.

The justices in the past have passed up the chance to hear challenges to similar laws in a handful of other states. But attorneys general in 21 states had asked the court to hear the Maryland case, and the National Rifle Association and other gun rights groups had joined the effort.

Maryland’s ban on “assault” weapons was passed after the 2012 mass shooting at a Newtown, Conn., elementary school.

A district judge had cast doubt on the constitutionality of the law. But the full U.S. Court of Appeals for the 4th Circuit in Richmond upheld the ban in a 10-to-4 vote.

That court went further than other appellate courts that have reviewed similar laws, stating that “assault weapons and large-capacity magazines are not protected by the Second Amendment.”

The majority opinion, written by Judge Robert B. King, refers to the banned firearms as “weapons of war” that the court says are most useful in the military.

In a strongly worded dissent, Judge William B. Traxler Jr. said his colleagues have “gone to greater lengths than any other court to eviscerate the constitutionally guaranteed right to keep and bear arms.”

Maryland Attorney General Brian E. Frosh (D) on Monday said there was no reason for the Supreme Court to review the lower-court ruling.

“The Maryland Firearm Safety Act is a common-sense law,” Frosh said in a statement. “The Supreme Court’s denial of certiorari confirms the principle that states may protect their citizens and communities from the devastation of these weapons of war. . . . Assault weapons, which have resulted in the slaughter of hundreds of people in recent months, are not protected by the Second Amendment.”

Gun rights groups contend that the term “assault weapon” is propaganda and that Maryland’s ban outlaws some of the country’s most widely owned weapons.

In its friend-of-the-court brief, the NRA urged the justices to clarify the reach of the Supreme Court’s landmark decision in District of Columbia v. Heller, which found a constitutional right to gun ownership for self-defense.

The 4th Circuit, the group wrote, “held that the Second Amendment provides absolutely zero protection to the most popular long guns in the country and standard-capacity ammunition magazines that number in the tens of millions.”

It added, “In no other context would such a widespread, overt, and severe entrenchment upon constitutional rights be tolerated.”

Despite the push from other states and the groups, Monday’s decision could not be termed a surprise. The justices have previously declined to review other lower-court decisions that uphold bans passed by cities and states. Maryland, California, Hawaii, Massachusetts and New Jersey, as well as many cities and towns, have similar laws.

In 2015, Justice Clarence Thomas criticized his colleagues for not accepting such a challenge. “The overwhelming majority of citizens who own and use such rifles do so for lawful purposes, including self-defense and target shooting,” Thomas wrote. “Under our precedents, that is all that is needed for citizens to have a right under the Second Amendment to keep such weapons.”

No member of the court wrote to explain the court’s decision not to hear the Maryland case, Kolbe v. Hogan.