The Medicines and Healthcare products Regulatory Agency (MHRA) closed down more than 1,600 websites illegally advertising and selling medicines last year.
Many of the medicines advertised on these websites were counterfeit of unlicensed.
MHRA's head of enforcement, Alistair Jeffrey, said: ' Buying medicines online is a risk, many websites operate outside the legal requirements and you have no idea what you are getting and how it will affect you.'
Medicines with a value in excess of £3m were seized. Theses included quantities of sleeping pills, antidepressants, erectile dysfunction medicines and slimming products.
An MHRA spokesperson said that healthcare professionals can advise patients on the best course of action if they have bought medicines through such sites.
'[The dangers are that] doses could be too high or too low, or the ingredients could break down incorrectly in the body which makes the medicine ineffective,' they said.
Additionally, 19,000 online videos were removed for illegally advertising medicines as part of the MHRA's continuing collaboration with sites such as YouTube, Amazon and eBay to identify and take action against illegal operators.