California prisoners can legally possess marijuana as long as they do not consume it, a California appeals court ruled Wednesday.

In the ruling, the 3rd District Court of Appeals reversed five Sacramento inmates’ criminal convictions for having marijuana in their cells.

ADVERTISEMENT

“Consumption, not possession, is the act voters determined should remain criminalized if the user is in prison,” according to the ruling.

Specifically, the ruling states, a 2016 voter referendum that allowed recreational marijuana use did not include any exemptions for incarcerated people.

Actual marijuana use remains a violation of the California penal code, and can still be punished, but possession alone cannot be the basis for criminal charges, according to the decision.

“The question of law we review de novo is whether the plain language of the statute leads to an absurd result. We conclude it does not,” the judges wrote in their decision. “A result is not absurd because the outcome may be unwise.”

Smuggling marijuana into prison will remain a crime, and prisoners could still be punished for possessing it under prison rules or subject to federal charges.

“It may be legal, but you can still ban it. Cellphones are legal. Pornographic images are legal. You can’t have either one in prison,” Lafayette attorney Dan Horowitz told The Mercury News.

The California Attorney General’s Office still has the option to appeal the ruling to the state supreme court.