The Supreme Court on Monday overturned a ruling by Massachusetts’s highest court that upheld a state law prohibiting the possession of stun guns.

The justices, in an unsigned and bare-bones opinion, said the Massachusetts Supreme Judicial Court misread their ruling in the landmark case District of Columbia v. Heller. That 2008 decision said the Second Amendment provided an individual right to gun ownership and provided guidance on what kinds of weapons were covered.

The Supreme Court has been considering a petition to accept the Massachusetts case for months, and its disposition Monday raised questions about whether it was decided differently because of the death of Justice Antonin Scalia.

The court’s 1 1 /2 -page per curium decision said the Massachusetts justices erred in several ways in ruling that stun guns, which produce a non-lethal electrical charge, were not covered by the Heller decision. The justices sent the case back for additional work but did not specifically overturn the Massachusetts law.

Justice Samuel A. Alito Jr. filed a 10-page concurrence that criticized the “grudging” opinion written by his colleagues and said the court should have struck down the law. This raised the prospect that Alito’s concurrence might once have been the court’s opinion but that it no longer had five votes on the now eight-member court.

The case involves Jaime Caetano, who bought a stun gun as a means of self-defense against her abusive former boyfriend. Although she never used it, she threatened him with it when he approached her one night as she left work.

Stun guns are allowed in the vast majority of states but banned in Massachusetts and a few others. Caetano was arrested and tried, and the Massachusetts court upheld the conviction.

That decision “does a grave disservice to vulnerable individuals like Caetano who must defend themselves because the state will not,” Alito wrote.

Alito said “each step” of the Massachusetts court’s reasoning was wrong.

“The state court repeatedly framed the question before it as whether a particular weapon was ‘in common use at the time of enactment of the Second Amendment,’ ” Alito wrote. “In Heller, we emphatically rejected such a formulation. We found the argument ‘that only those arms in existence in the 18th century are protected by the Second Amendment’ not merely wrong, but ‘bordering on the frivolous.’ ”

Alito added: “Electronic stun guns are no more exempt from the Second Amendment’s protections, simply because they were unknown to the First Congress, than electronic communications are exempt from the First Amendment, or electronic imaging devices are exempt from the Fourth Amendment.”

He said the weapons must be both “dangerous and unusual” to be questionable.

“While less popular than handguns, stun guns are widely owned and accepted as a legitimate means of self-defense across the country,” Alito said. “Massachusetts’ categorical ban of such weapons therefore violates the Second Amendment.”

Alito said there was no need for his colleagues to return the case to the Massachusetts court.

“If the fundamental right of self-defense does not protect Caetano, then the safety of all Americans is left to the mercy of state authorities who may be more concerned about disarming the people than about keeping them safe,” Alito wrote.

Alito’s concurrence was joined by Justice Clarence Thomas. Thomas and Scalia in the past criticized their colleagues for not accepting challenges to gun restrictions that gun rights proponents have said violate Heller.

Since Scalia’s death Feb. 13, Thomas and Alito have been more outspoken in disagreeing with their colleagues about whether to accept certain cases.

While only Thomas signed on to Alito’s concurrence Monday, that is not an indication that other justices did not at one time agree with it.

The case is Caetano v. Massachusetts.