Products that contain a cannabis-based ingredient called cannabidiol or CBD are medicines, UK regulatory body the MHRA has said.
It has written to 18 companies letting them know they now have 28 days to get a licence to legally sell such products in the UK.
Currently, there is only one licensed medicine available in the UK that contains CBD.
It is a prescription-only drug called Sativex for patients with MS.
Patients are given it to ease their symptoms of muscle spasms.
Sativex contains CBD and another extract, THC, which are both derived from the cannabis plant.
Cannabis itself, however, is not recognised under UK laws as having any therapeutic value, and anyone using it, even for medical reasons, could be charged with possession.
The MHRA said it had looked at CBD because a number of manufacturing companies had been making "overt medicinal claims" about products.
The decision to classify them as medicine means manufacturers will now need to demonstrate their CBD products meet safety, quality and effectiveness standards.
Soon, anyone selling or advertising CBD products in the UK without a licence from the MHRA could face an unlimited fine and, potentially, a two-year prison sentence.
An MHRA spokeswoman said: "If you use CBD and if you have any questions, speak to your GP or other healthcare professional.
"We have written to UK CBD stockists and manufacturers to inform them of our view.
"We can provide regulatory guidance to any company who may wish to apply for a licence."