SACRAMENTO (AP) — Prison inmates can’t legally possess marijuana under California’s law allowing recreational pot, the state Supreme Court ruled Thursday in overturning a lower court that found prisoners could have the drug as long as they didn’t consume it.

The justices said the 2019 appellate court ruling allowing prisoners to have up to 1 ounce (28.5 grams) of marijuana went against common sense. The high court sided with the state attorney general in finding the state’s marijuana law approved by voters did not apply to Californians in prison.

READ MORE: Scott Peterson Set To Be Re-Sentenced For Murder Of Pregnant Wife

“It seems implausible” that the voters intended to essentially decriminalize marijuana in prisons, Associate Justice Joshua Groban wrote for the majority.

“We agree with the Attorney General that if the drafters had intended to so dramatically change the laws regarding cannabis in prison, we would expect them to have been more explicit about their goals,” he wrote.

California in 1996 became the first state to legalize medical marijuana, and 20 years later voters approved Proposition 64 establishing the world’s largest legal recreational pot marketplace. People 21 or older can legally possess up to an ounce of marijuana.

Medical marijuana also remains illegal in California prisons.

The case before the Supreme Court arose from the conviction of five men who were found with marijuana in their cells. The Sacramento-based 3rd District Court of Appeal overturned the convictions, ruling that while state law made it illegal to smoke or eat pot in prison, it didn’t specifically criminalize possession.

Other California appeals courts had ruled that possessing cannabis in prison still was illegal.

READ MORE: Person, Cat Rescued From Citrus Heights Apartment Fire

In the 5-2 Supreme Court decision, Groban wrote: “While perhaps not illogical to distinguish between the possession and use of cannabis, it is nonetheless difficult to understand why the electorate would want to preclude laws criminalizing cannabis possession in prison, but permit laws criminalizing cannabis consumption in prison.”

Associate Justice Leondra Kruger, writing in partial dissent, agreed that the ballot measure did not legalize cannabis possession in California’s prisons and jails. But she said it left open the question of whether prosecutors could continue to file charges the same way they previously could, by choosing between what she called two overlapping felony statutes, one with tougher penalties than the other.

Voters could have intended to provide a “limited measure of leniency” for inmates caught with cannabis, she reasoned, even while not decriminalizing possession behind bars. She also said the court shouldn’t have addressed the legality question at all, based on the way the appeal was framed.

She was joined by one other justice, Mariano-Florentino Cuéllar.

The lower court said corrections officials still could ban possession as a rules violation, just as they do for alcohol or tobacco, but not seek new felony charges that could add years to prisoners’ sentences.

“We are sympathetic to the view that (existing law) creates extreme disparity between how our legal system treats the possession of cannabis generally versus the possession of such a substance inside a correctional facility. That is also true of many other substances, including alcohol,” Groban wrote.

“Some may well view an eight-year prison sentence for the possession of less than one gram of cannabis (one gram is the approximate weight of a single paper clip or a quarter teaspoon of sugar) as unduly harsh,” he wrote. “The wisdom of those policy judgments, however, are not relevant to our interpretation of the statutory language.”

MORE NEWS: Deputies Searching For Home Invasion Robber Who Targeted Mountain House Residence

Copyright 2021 The Associated Press.