MINNEAPOLIS — Evidence that a defendant can legally use marijuana for medical purposes in another state isn't relevant when that person is on trial for violating Minnesota's drug laws, the state Court of Appeals ruled Tuesday.

The 18-page ruling came in the case of Jeffrey Thiel, 31, who was convicted of fifth-degree possession of a controlled substance after authorities in Itasca County found two jars of raw marijuana under the hood of his vehicle in 2011. He had tried to get the case dismissed, saying Minnesota's law classifying marijuana as a Schedule I controlled substance violates his rights of equal protection.

He had also argued he was improperly denied the right to present a defense showing that California allows him to grow 99 marijuana plants and have 19 pounds of processed marijuana for his yearly medical needs to control chronic pain.

But a three-judge panel of the appeals court rejected his arguments.

"Minnesota need not incorporate California's decision to permit medical patients to possess and use marijuana," the judges wrote, adding: "Although this testimony may have helped appellant to explain his conduct to a jury, it would not have excused his conduct and it also would have served to confuse and mislead the jury."

Thiel's attorney and prosecutors didn't immediately return messages seeking comment.

Minnesota recently passed medical marijuana legislation that bans people from smoking the drug but would allow patients with certain conditions to use it in oil, pill or vapor form. Doctors would not prescribe the drug, but could diagnose a patient with a qualifying medical condition, allowing that patient to apply to receive the treatment.

At the time of Thiel's arrest, Minnesota didn't recognize marijuana for medical use.

Still, Thiel claimed his rights of equal protection were violated because Minnesota classifies marijuana as a Schedule I controlled substance, a drug with no accepted medical use in the United States. Schedule II substances, on the other hand, can be prescribed in Minnesota. Thiel argued that those who have medical marijuana prescribed to them should be treated the same as patients with prescribed Schedule II substances.

The appeals court disagreed.

"Given the continuing debate over the extent of the use of marijuana for medical purposes, there is a legitimate state purpose in classifying marijuana as a Schedule I substance and treating possessors of marijuana for medical use differently than possessors of Schedule II substances for medical use," the judges wrote.

The judges said a decision on whether to reschedule medical marijuana as a Schedule II controlled substance should be left to the Legislature and governor's office.