Maryland Attorney General Brian Frosh helped pass the state’s ban on “assault weapons” after the 2012 mass shooting at Sandy Hook Elementary School in Newtown, Conn. (Jonathan Newton/The Washington Post)

A federal appeals court on Wednesday considered the legality of Maryland’s ban on certain semiautomatic firearms passed after the 2012 mass shooting at a Newtown, Conn., elementary school.

The full U.S. Court of Appeals for the 4th Circuit agreed to rehear the case after a three-judge panel cast doubt on the constitutionality of the law that also prohibits magazines that hold more than 10 rounds of ammunition.

Judges had tough questions for both sides as they weighed how far the Maryland legislature could go to limit individual rights to gun ownership.

Attorney John Parker Sweeney, who argued for firearms dealers and gun rights advocates, told the court that handguns protected by the Second Amendment are more dangerous than the firearms banned by the Maryland law.

Assistant Attorney General Matthew Fader acknowledged that handguns are used in more crimes — nearly 95 percent of homicides statewide. But, he said, the ban was appropriate because the Maryland General Assembly had determined that such firearms are used disproportionately in mass shootings and result in more shots fired and more people injured.

Several of the judges who asked questions Wednesday at the ­Richmond-based court appeared to agree. Judge J. Harvie Wilkinson III said the legislature had not acted in a “cavalier way” and was within its power to restrict the types of firearms that had been used not for self-defense, but for “offense” in mass shootings in places such as Aurora, Colo., Fort Hood, Tex., and Tucson.

“What are we to tell the people of this country? That there’s nothing we can do?” Wilkinson said.

Maryland’s law bans semiautomatic long guns with certain ­military-style features that the measure refers to as “assault weapons.” The law does not ban all long guns, rifles or semiautomatic rifles.

Gun restrictions enjoy wide support in the Democratic-leaning state, a factor that helped legislators pass some of the nation’s strictest gun-control laws in 2013. A Washington Post poll that year found 63 percent supporting a ban on assault weapons, including 56 percent who backed the measure “strongly.”

On Wednesday, Judge Paul V. Niemeyer and G. Steven Agee pressed the government, asking what would stop the legislature from broadening the ban.

“Why can’t the Maryland General Assembly ban all semiautomatic shotguns kept by millions of target shooters and hunters?” Agee asked.

Fader said the legislature had gathered sufficient evidence that “assault weapons” are “particularly dangerous” and had not drawn the same conclusion about the other firearms.

Opponents, including a group of Maryland gun store owners, say the 2013 ban prevents law-abiding citizens from possessing semiautomatic rifles “commonly kept by several million American citizens for defending their families.”

Judge Diana Motz appeared skeptical about whether the common use of a particular firearm should dictate whether it could be restricted by the legislature, and she said there was no precise way of measuring popularity. “We don’t have a national gun registry, so we don’t know,” Motz said.

In response, Sweeney said, “popularity is determined by what law-abiding citizens choose. They choose firearms that work for them.”

The question for the panel of 14 judges is what legal standard the U.S. District Court in Baltimore should use to evaluate the ban.

In a 2-to-1 decision in February, Agee and Chief Judge William B. Traxler Jr. found that the lower court should have used a more stringent test to assess the law. The bar should be higher for the state, the court said, when the government passes a law that affects a right protected by the Constitution.

The Supreme Court in 2008 used a D.C. case to declare for the first time that the Second Amendment guarantees an individual right to gun ownership rather than one related to military service. The ruling overturned the District’s long-standing ban on handguns.

Judge Robert B. King wrote in his dissent: “Let’s be real: The assault weapons banned by Maryland’s [law] are exceptionally lethal weapons of war” and as such, he said, not constitutionally protected.

The government noted on Wednesday that another federal appellate court, the U.S. Court of Appeals for the 2nd Circuit, had upheld similar, more restrictive bans in New York and Connecticut as constitutional.

[Read more on the 4th Circuit’s initial ruling on Maryland’s gun law]

If the full court in Richmond reverses, gun rights advocates say it would upend past practice by other lower-court judges.

“Such a decision would further erode the rights of law-abiding citizens to own protected firearms to the point where they would be equated with criminals, domestic violence misdemeanants, and illegal drug users,” according to those challenging the law, including the Maryland State Rifle and Pistol Association, the Maryland Licensed Firearms Dealers Association and Maryland business owner Stephen Kolbe.

Maryland Attorney General Brian E. Frosh, who attended oral arguments Wednesday, said the Second Amendment does not prevent legislators from passing measures designed to protect the public from gun violence.

“The types of guns banned are designed for military purposes,” Frosh said. “They are not necessary for lawful purposes. They are weapons of mass destruction.”

Scott Clement contributed to this report.