The Arizona Court of Appeals Thursday upheld a state law requiring bicyclists to use lights while riding at night.

The ruling came in a case from July 2011, when Phoenix police stopped Brian Baggett for riding his bicycle without a light at night.

He was later arrested and charged with possession of methamphetamine, marijuana and other drug paraphernalia found in a backpack he was carrying.

In court, his public defender argued Baggett should not have been stopped in the first place and he did not need a light because he was riding on the sidewalk.

The appellate judge ruled against Baggett, citing an Arizona statute that requires cyclists to use lights after dark.

In this case the court is correct, said Eric Post, an attorney who sits on the Tucson-Pima County Bicycle Advisory Committee.

“It means if they are going to ride at night they absolutely have to have lights in the front and at least a reflector in the back," Post said.

Baggett also violated a city of Phoenix ordinance that makes it illegal for a bicyclist to ride on the sidewalk. Tucson has a similar ordinance unless signs indicate otherwise.