The rise of social media and greater internet access through smartphones are factors behind a huge rise in illicit sales of pharmaceuticals, according to the chief enforcement official at Britain’s medicines regulator.

Criminal gangs have become adept at using social media to sell “lifestyle” drugs to a mass market at minimal risk and cost, said Alastair Jeffrey, head of enforcement at the Medicines and Healthcare Products Regulatory Agency (MHRA). This year, he said the MHRA had seized 1.2m doses of illegally supplied erectile dysfunction drugs, 383,000 slimming products and 331,000 doses of sleeping pills, tranquillisers and antidepressants – mostly originating from China and India. For the first time, the MHRA pursued YouTube accounts and removed 18,671 videos that directed viewers to websites offering illicit drugs.

Many gangs operate through websites that claim to be bona fide online pharmacies. They focus on medicines that people might be reluctant to discuss with their GP or pharmacist, such as Viagra and other erectile dysfunction drugs, as well as slimming pills and hair loss treatments. Sales of anabolic steroids for bodybuilders and cognitive enhancers, some of which have not been tested in humans, are booming.

“This is something we are looking at now in a serious way. There is a phenomenal market out there,” said Jeffrey, a former detective chief superintendent who ran the Met’s child abuse investigation command centre. “Smartphones have allowed people greater access to the internet, and all of a sudden this accessibility, combined with social media, has made a significant difference in how criminals reach consumers.”

Criminals have moved into the area of prescription drugs and similar treatments because the profits to be made far outweigh those to be made from narcotics such as cocaine, heroin and cannabis. The risks are lower, too, with jail sentences for handling unlicensed or fake medications a fraction of those doled out for dealing in class A substances.

Bernard Leroy, director of the International Institute of Research Against Counterfeit Medicines in Paris, said gangs that sold counterfeit drugs stood to make €200-€500 (£390) for every single euro invested. In 2010, the World Customs Organisation estimated that the global market for counterfeit drugs was worth $200bn (£130bn), putting it ahead of prostitution. The combined heroin and cocaine markets are worth $160bn. About half of the drugs sold on the internet are counterfeits, according to the World Health Organisation.

Criminal groups use a number of different approaches to make money from prescription drugs. Fake pills can be made from scratch from various powders, including harmful ones. They can be laced with a small amount of the drug’s active ingredient to ensure they pass chemical tests. Some gangs obtain discarded out-of-date drugs and repackage them with fresh dates, or buy cheap generic drugs and resell them after replacing the labels and packaging to make them look like top-brand medicines.

In Britain, the MHRA works with internet domain registries, credit card companies, Interpol and sites such as YouTube, Amazon and eBay to identify rogue traders, take down their websites and close their accounts.

Raids organised with the MHRA have found drugs ready for shipment stored in appalling conditions. “In many cases they are not stored properly at all. We have had cases where there have been mouse and rat droppings around the blister packs. These people are not interested in sanitary conditions, they are in it for the money,” said Jeffrey.

Besides the obvious risks of taking medicines made from rat poison and other substitutes used by gangs, there are also dangers in taking medicines without proper consultation. “There are definitely health risks because a patient might have a condition that means they should not take a certain drug. The problem we have is identifying people who are victims because they don’t say ‘I bought sildenafil on the internet and suddenly got heart palpitations’,” Jeffrey added.

Leroy in Paris, said the European commission had compounded the problem by allowing e-pharmacies to operate online. This had led criminal groups, mainly from former Soviet Union states, to set up websites that duped visitors into thinking they were registered European e-pharmacies, he said.

“We are in a situation where internet usage is growing so fast that we are at risk of losing control,” Leroy told the Guardian. Gangs that sold counterfeit drugs stood to make between 200 and 500 euros for every single euro invested, Leroy said. In 2010, the World Customs Organization estimated the global market for counterfeit drugs at $200bn, putting it ahead of prostitution. The combined heroin and cocaine markets are worth $160bn. About half of the drugs sold on the internet are counterfeits, according to the World Health Organisation.“This will become a major issue for public health in coming years. People are more and more focused on obtaining these medicines and people are going to the internet for them.”

In July, Dutch researchers published a report in the British Medical Journal on the success of thousands of rogue online pharmacies. Led by the National Institute for Public Health and the Environment in Bilthoven, the study measured levels of sildenafil, the active ingredient in Viagra, in sewage from Amsterdam, Eindhoven and Utrecht. After comparing the levels found with those expected from official dispensing records, the scientists concluded that at least two-thirds of the drugs in use came from illicit sources, most probably online pharmacies.

A spokesperson for YouTube said users posted 300 hours of content every minute of every day to its servers. If viewers suspected that videos were promoting illegal goods, they were asked to report the account to a team of YouTube reviewers.

eBay said its sellers were prohibited from listing prescription drugs, in line with its medicine and healthcare products policy. “In addition to our own filters and other technology, eBay works closely with the MHRA and other regulators across the globe who have a direct line to eBay and enable us to remove any listings of concern as soon as they are reported,” a spokesman said.