A federal judge on Tuesday upheld Maryland’s ban on assault weapons and large-capacity magazines.

The law banning the guns, which was passed in May 2013, was challenged in court by a group of nine plaintiffs including gun stores, gun ownership organizations, and individuals.

“Upon review of all the parties’ evidence, the court seriously doubts that the banned assault long guns are commonly possessed for lawful purposes, particularly self-defense in the home, which is at the core of the Second Amendment right,” U.S. District Judge Catherine C. Blake wrote.

She concluded as well that “the Act substantially serves the government’s interest in protecting public safety.”

The Supreme Court declared, in the landmark Heller case which struck down the District’s gun ban in 2008, that individuals have the right to gun ownership. But states have the power to regulate that right, Blake wrote.

Maryland’s law, passed five months after the mass shooting in an elementary school in Newtown, Conn., made the possession or sale of an assault weapon or a magazine capable of holding more than 10 rounds of ammunition a misdemeanor in Maryland.

A federal law banning assault weapons expired in 2004. A few other states ban the weapons.

In making the case that the weapons banned in Maryland are commonly used and thus may fall under the Supreme Court’s definition of constitutionally protected guns, the plaintiffs said that somewhere from 5 million to 8.2 million assault weapons are owned nationwide. Witnesses called by the state to defend the law mostly agreed on the number but pointed out that a small fraction of Americans own these guns. One witness said that on average assault weapons owners possess 3.1 guns each.

Blake said she was convinced that the guns are not commonly owned. Furthermore, she found little evidence that they would be useful for self-defense.

“As for their claims that assault weapons are well-suited for self-defense, the plaintiffs proffer no evidence beyond their desire to possess assault weapons for self-defense in the home that they are in fact commonly used, or possessed, for that purpose,” she wrote.

Law enforcement officers who testified in the case could not identify a single time that a Maryland resident used an assault weapon for self-defense.

Magazines holding more than 10 rounds were used in 85 percent of the mass shootings over the last 30 years in which the magazine capacity was known, a witness told the court.

Most of the nine plaintiffs who tried to take down the ban declined or did not respond to requests for comment on Tuesday afternoon. Their attorney, John Parker Sweeney, was out of the country, and his office did not respond to a request for comment.

Steve Schneider, the owner of Atlantic Guns, a Maryland gun store which was one of the plaintiffs, said, “It’s one that we’re in for the long haul. I’m expecting that this will go on appeal.” Otherwise, he declined to talk about the ruling.

Vincent DeMarco, president of the board of Marylanders to Prevent Gun Violence, praised Blake’s decisive ruling.

“ States should have the authority to protect citizens from these weapons of mass destruction,” he said.

Get updates on your area delivered via e-mail