Restrictions on the use of so-called legal highs have led to an 80% reduction in hospital admissions, an Edinburgh University study has found.
Police and trading standards began a crackdown on the drugs in the capital in 2015.
UK-wide legislation was introduced the following year.
Researchers examined anonymous health records of patients who came to hospital suffering the effects of drug use.
It is the first study to evaluate the impact on hospitals from this type of drug.
They said the findings suggest the actions were having a significant impact on reducing harm in the capital.
Michael Eddleston, professor of clinical toxicology at Edinburgh University's BHF Centre for Cardiovascular Science, said: "Our findings suggest temporary class drug-orders, combined with local trading standards, were very successful in reducing novel psychoactive substance (NPS) harm in Edinburgh.
"Widespread adoption of trading standards enforcement, together with focused legislation, seemed to turn the tide against these highly-damaging drugs.
"These restrictions may have offered health benefits and saved the NHS substantial funds each year."
Emma Crawshaw, chief executive of drugs information charity Crew 2000, said the research backed up its own anecdotal evidence on the use of novel psychoactive substances.
She said: "We always welcome research into the impacts and enforcements and we noticed there was a really sharp decrease in the number of people coming to us with NPS related harm at Crew and our Edinburgh-based services."
However, she said there was evidence that people were using other types of drug instead.
"What we also noticed was at the time when the temporary class drug-orders and the general product safety regulations were enacted in Edinburgh and NPS were taken off the shelves we noticed more people coming to us using coke and traditional drugs that perhaps they had been using before," she said.
Dr James Dear, an A&E consultant in Edinburgh, said: "Before these changes were put in place in Edinburgh we were seeing an enormous surge in patients coming in, particularly with ethylphenidate, which was causing horrific skin lesions, agitation and real management problems.
"But since the changes were made locally the numbers have fallen off dramatically. Ethylphenidate is a drug we rarely see now.
"We still see patients who have taken legal highs but far fewer numbers."