BOSTON (Reuters) - The top court in Massachusetts on Tuesday struck down a state law that banned civilians from possessing stun guns, ruling unanimously that the law violated the U.S. Constitution’s Second Amendment, which protects Americans’ right to bear arms.

FILE PHOTO: An X26P Taser gun is shown on display at the Taser booth during the International Association of Chiefs of Police conference in San Diego, California, U.S. October 17, 2016. Picture taken October 17, 2016. REUTERS/Mike Blake/File Photo

The Massachusetts Supreme Judicial Court ruled in the case of a man who was criminally charged for possessing a stun gun, holding that such weapons constitute “arms” as protected by the Constitution.

“Therefore, under the Second Amendment, the possession of stun guns may be regulated, but not absolutely banned,” Chief Justice Ralph Gants wrote for the 6-0 court.

The court dismissed a criminal stun gun possession charge against Jorge Ramirez, who was arrested in 2015 after police discovered one in his pants pocket following a traffic stop. He also was charged with firearms offenses.

The court delayed the ruling’s effect for 60 days to allow lawmakers time to consider regulating stun guns. A spokesman for Suffolk County District Attorney Daniel Conley, a Democrat whose office defended the law, said his office backed doing so.

“We believe the current restrictions on stun guns can be updated in a manner consistent with the high court’s ruling and Massachusetts’ common-sense firearm legislation,” said Conley’s spokesman Jake Wark.

Ramirez’s lawyer could not be reached for comment.

The ruling came amid renewed attention as to the reach of the Second Amendment after a gunman killed 17 students and staff at a Florida high school in February, prompting a surge of gun control activism by teenage students nationally.

The ruling follows an earlier 2015 decision in which the court upheld the stun gun ban in the case of a woman who was arrested for possessing one she said she carried as protection against an abusive former boyfriend.

But in 2016, the U.S. Supreme Court, in an unsigned ruling with no dissents, overturned that holding, finding it was inconsistent with a 2008 Supreme Court decision declaring an individual’s right to bear arms.

The Supreme Court took issue with the Massachusetts court’s finding that stun guns are “unusual” because they are a “thoroughly modern invention,” and sent the case back to the state court for further proceedings.

In Tuesday’s ruling, Gants cited that guidance in holding that the stun gun ban was unconstitutional.

He said the state may place restrictions on who can own them, require licenses for people who possess them and restrict stun guns from being carried in schools and government buildings.