The battle over designer drug delta-8 THC has taken an interesting turn now that a unanimous court ruling has determined that it is legal under federal law.

Last month a panel of the U.S. Court of Appeals for the Ninth Circuit ruled that products containing delta-8 THC derived from hemp can be sold legally, because the 2018 Farm Bill’s definition of “hemp” includes “‘any part of’ the plant Cannabis sativa L. ‘and all derivatives, extracts, [and] cannabinoids …, whether growing or not,’ with a delta-9 THC concentration of no more than 0.3 percent on a dry weight basis.” The judges also write, “The Act is silent with regard to delta-8 THC.”

This may come as a blow to activists who are concerned that an unregulated market around the drug could lead to public health problems, and that delta-8 THC will be able to fall into the hands of children.

The most prominent cannabinoid found in cannabis is delta-9 THC. When a consumer purchases marijuana from a dispensary, this is the compound referred to as “THC” on the label. Delta-8 THC is a similar cannabinoid that is also found in marijuana in smaller concentrations. It is reportedly a milder intoxicant than delta-9 THC. Users claim it promotes relaxation and euphoria while also providing pain relief. It’s said that the drug is psychoactive but provides a less intense high than cannabis.

The legality of this cannabinoid has been a hot topic for months. Clever extractors have learned how to process hemp-derived CBD into delta-8 THC all while remaining well within the confines of the law. But a number of states have already moved to enact local laws banning the substance.

A case of counterfeit products has brought the matter to the attention of federal judges. According to court documents, an e-cigarette company sued a storefront for allegedly selling counterfeits of its delta-8 THC vaping products. The storefront countered that the company could not hold protectable trademarks for its products because delta-8 THC “remains illegal under federal law.”

In its ruling, the court recognized that delta-8 THC was a psychoactive compound but confirmed that it was legal as long as it was extracted from hemp.

“Regardless of the wisdom of legalizing delta-8 THC products, this Court will not substitute its own policy judgment for that of Congress,” Judge D. Michael Fisher wrote in the ruling, which passed unanimously.

Fisher wrote that if “Congress inadvertently created a loophole legalizing vaping products containing delta-8 THC, then it is for Congress to fix its mistake,”

Fans of the drug aren’t out of the woods yet, however. Federal agencies have their eye on the compound and have already started signaling that they want to regulate or even ban it altogether. Last month the U.S. Food and Drug Administration (FDA) issued warnings to five companies ordering them to stop making health claims about their delta-8 THC products. The agency also published a warning to consumers about the potential health risks of the drug.