The Minnesota Supreme Court overturned the conviction of a felon sentenced to five years in prison for the possession of a small BB gun, ruling Wednesday that the air-powered weapon is not a firearm.

Though the decision vacates the conviction upheld by the Minnesota Court of Appeals, it is not broad-sweeping. The ruling only covers Minnesota’s felon-in-possession statues, not someone who chooses to actually fire it.

Since 1977, the state’s two appellate courts have repeatedly agreed with the Legislature that a BB gun is a firearm when involved in various crimes, such as drive-by shootings.

David Lee Haywood, 38, of Minnetonka, remains incarcerated at a state facility in Oak Park Heights following a mandatory five-year sentence for the Ramsey County possession charge. A 2005 felony drug conviction prevented him from having a handgun when police found a BB gun in his car’s glove compartment during a traffic stop in 2013.

Haywood owned a Walther CP99 Compact .177-caliber BB gun — which looks like a standard Walther P99 handgun, according to court documents. Police stopped him while driving in downtown St. Paul, discovering that he’d violated a no-contact order filed on behalf of a woman who was a passenger in the vehicle. Authorities found the BB gun during their subsequent search.

During his trial on the weapon charge, the jury was instructed that a BB gun is a firearm under state law. The Appeals Court later relied on a 1977 state Supreme Court case of an armed robbery in which the defendant used a BB gun. That fit the definition of a firearm in the game and fish laws, it was ruled.

The Supreme Court disagreed, arguing that the plain meaning of “firearm” does not include an air-powered BB gun. A firearm, it ruled, is defined as a weapon from which a shot is discharged by gunpowder. A BB gun can’t be defined in that way because it doesn’t use explosive force, according to court records.

The state Supreme Court added that regardless of the means of propulsion, “a BB gun is capable of producing death or great bodily harm. But that is arguably true of nail guns and other devices that use compressed air, as well,” wrote Associate Justice Natalie E. Hudson.

“Even so, the question of how to define a ‘firearm’ is best left to the Legislature.” she added.

Ramsey County Attorney John Choi said he was disappointed with Wednesday’s ruling, which would force the dismissal of any pending cases in which a felon was alleged to be in possession of an “air-powered” firearm. Choi called on the Legislature to provide further clarity on the issue.

“For the public’s sake, there should be a clear prohibition and serious penalties for felons who carry ‘air-powered’ guns,” Choi wrote in a statement to the Star Tribune. “These ‘air-powered’ guns are not yesterday’s Daisy Riders. They look identical to popular handguns, have immense firepower, and too often are involved in criminal activity or tragic events.”

Haywood was expected to be released from prison next August, according to the state Department of Corrections website. It remains unclear how soon the ruling will make him eligible now. Haywood’s public defender and caseworker could not be immediately reached for this story.