CONCORD, N.H. — The New Hampshire Supreme Court says ammunition must be in a weapon and not just near it for a gun to be loaded under state law.

The court’s unanimous ruling means the Class A misdemeanor charge against 31-year-old Oriol Dor of Manchester will be thrown out. A Class A misdemeanor is punishable by up to one year in jail and a $2,000 fine.

At dispute was the meaning of the single word “with” in state law.

The law prohibits people from carrying a loaded weapon in a vehicle or concealed on their body without a license, and defines a loaded pistol or revolver to be any gun “with a magazine, cylinder, chamber or clip in which there are loaded cartridges.”

During a search of Dor’s vehicle in May 2012, police found an unloaded, semi-automatic pistol and a loaded magazine in his glove compartment.

Prosecutors argued that the law should be construed broadly to include the proximity of ammunition to the weapon in the interest of public safety.

In his motion to dismiss the charge, Dor’s lawyer argued that the said the gun was not loaded and that no law was broken. A Manchester District Court judge did not rule on the motion and referred the question about the definition of “loaded” to the Supreme Court.

In its decision released Wednesday, the court said the definition sought by prosecutors would create ambiguity about how close to the gun the ammunition had to be to violate the law. They also said that if the Legislature had intended a broader definition of “loaded” gun it would have made that clear.

“(The law) provides no indication that the Legislature intended ‘loaded’ to be defined so broadly as to encompass pistols and revolvers near ammunition,” Justice Robert Lynn wrote.

Dor’s lawyer didn’t immediately return a call seeking comment.