ST. PAUL, Minn. (AP) — A federal appeals court on Thursday affirmed the conviction of a former Minnesota head shop owner who openly sold millions of dollars’ worth of synthetic drugs from his store in downtown Duluth.

The 8th U.S. Circuit Court of Appeals ruled that the synthetic drugs law that sent James Robert Carlson to prison is constitutional, that the evidence was sufficient to convict him, and that key decisions by the judge during his 2013 trial were correct.

U.S. District Judge James Doty sentenced Carlson in 2014 to 17½ years in prison and ordered him to forfeit $6.5 million. His case was one of the first major tests in federal court of how effectively authorities can combat synthetic drugs. The drugs mimic the effects of marijuana, stimulants and hallucinogens, and carry labels such as “herbal incense,” ”spice” or “bath salts.” They’re difficult to regulate because manufacturers keep tweaking the formulas.

Carlson’s attorney, Mark Nyvold, said he had no comment on the ruling, except that he and Carlson would discuss the possibility of another appeal.

Nyvold had argued that the key law in the case — the federal analogue drug act — was unconstitutionally vague. But the three-judge appeals panel noted that the U.S. Supreme Court upheld the law in a separate case last year. The panel said evidence proved that Carlson knew the chemical structures or effects of the drugs he sold at his store, The Last Place on Earth, were substantially similar to those of controlled substances.

The appeals court also rejected the claim that Carlson should have been allowed to present an entrapment defense based on comments by a Drug Enforcement Agency spokeswoman about the difficulty of combatting synthetic drugs.

According to the Bureau of Prisons website, Carlson, 58, is serving his sentence at the low-security federal prison in Milan, Michigan, with a projected release date of December 2028.

The appeals court also affirmed the convictions and sentences of Carlson’s co-defendants who both worked at the shop. His girlfriend, Lava Marie Haugen, was sentenced to five years in prison. His son, Joseph James Gellerman, got three years of probation.

(© Copyright 2016 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)