MEDICINE HAT, Alta. - The Alberta Court of Appeal has ordered a new trial for a southern Alberta man accused of trafficking the deadly opioid fentanyl.

Jason Claude Tremblay was charged in Medicine Hat in 2014 with possession for the purposes of trafficking after police seized more than 800 fentanyl pills.

Provincial court Judge Darwin Greaves acquitted Tremblay of trafficking and found him guilty of simple possession, sentencing him to one year in jail.

The Crown had sought a four-year jail term, citing the large amount of fentanyl seized.

A panel of three Appeal Court justices says the judge made an error in law when he qualified a drug addict to testify as an expert witness in the case.

The panel says the trial judge relied heavily on this evidence to determine there was reasonable doubt.