MINNEAPOLIS (AP) _ The Minnesota Court of Appeals has found that people with prior drug convictions can't be required to undergo random drug testing indefinitely as a condition of receiving state welfare benefits.

Monday's ruling comes in the case of 62-year-old Kim Verhein, who lost her Minnesota Supplemental Aid benefits when she refused to take a drug test in 2015.

Verhein was convicted of drug possession in 1999 and had finished her sentence in 2001. Under state law, a person convicted of certain drug crimes after July 1, 1997, is ineligible for benefits until five years after completing a sentence. Those who become eligible are subject to random drug testing.

Verhein argued the law shouldn't apply to her because it had been more than five years since she finished her sentence. The appeals court agreed.