The state's highest court has ruled that possession of an open container of alcohol in a car is a civil infraction, not a criminal offense.

Supreme Judicial Court Justice Scott Kafker delivered the ruling Friday in a case in which the defendant was earlier found guilty by a jury of possessing an open container while driving. The defendant argued in his appeal to the SJC that the charge did not constitute a crime.

Kafker ruled in his favor, arguing the charge better fits in the definition of a civil motor vehicle infraction under the law.

"The open container statute was originally enacted to protect against drunk driving and, despite more recent amendments to the statute, is still aimed at that purpose. Accordingly, possession of an open container of alcohol in a motor vehicle is a civil motor vehicle infraction, rather than a criminal offense," the court wrote in its opinion.

Legal observers said Friday the court clarified the law because lower judges have treated the infraction differently. The decision overrules a 2011 case in which a judge ruled the charge was criminal.

Hampden District Attorney Anthony Gulluni said the change in how open container violations are categorized won't change much for prosecutors combating drunk driving.

"Often you'll see those charges run alongside an OUI — operating under the influence — charge, and they're typically add-ons that really become insignificant in the overall prosecution and sentencing of an offense," he explained.

Gulluni said there could be roughly a dozen cases in his county affected by the SJC's ruling.

Correction: An earlier version of this post misidentified the justice who presided over the ruling. The post has been updated. We regret the error.