The state Supreme Court has ruled that the presence of non-impairing marijuana compounds detected in a person's body does not give authorities the right to prosecute under Arizona's driving under the influence laws.

Last year, the state Court of Appeals upheld the right of authorities to prosecute pot smokers for DUI even when there is no evidence of impairment.

The Supreme Court opinion released Tuesday notes that while Arizona statute makes it illegal for a driver to be impaired by marijuana use, the presence of a non-psychoactive compound does not constitute impairment under the law.

Some of those compounds, known as metabolites, can stay in the body for weeks and do not cause impairment.

The justices pointed out that Arizona's medical marijuana law means someone could legally have those compounds in their blood. They said having the compounds does not mean impairment.

The justices also said driving under the influence of marijuana is still illegal.

Read the ruling here.

The Associated Press contributed to this report