Overuse of antibiotics was chiefly responsible for a serious stomach bug outbreak that spread through UK hospitals in the mid-2000s, research has shown.
Limiting antibiotic treatment rather than a deep cleaning programme introduced in 2007 eventually brought the epidemic under control, scientists believe.
The findings highlight the threat to public health posed by unrestricted use of antibiotics, which promotes bacterial drug resistance.
Severe cases of diarrhoea in hospitals caused by the bug Clostridium difficile (C. diff) first hit the headlines in 2006.
The following year, a programme of deep cleaning aimed at combating lack of hygiene in hospitals was announced by the NHS.
But according to the new study, the C. diff problem in hospitals was only overcome when use of fluoroquinolone antibiotics, which include the common drug ciprofloxacin, was restricted and made more targeted.
Cutting back on ciprofloxacin and related antibiotics led to an 80% fall in drug-resistant C. diff infections in the UK.
Meanwhile the smaller number of cases caused by C. diff bugs not resistant to fluoroquinolone antibiotics remained the same.
Control measures such as better handwashing had no impact on the number of C.diff bugs transmitted between people in hospital, said the researchers.
Professor Derrick Crook, a microbiologist from Oxford University, said: "Alarming increases in UK hospital infections and fatalities caused by C. difficile made headline news during the mid-2000s and led to accusations of serious failings in infection control.
"Emergency measures such as 'deep cleaning' and careful antibiotic prescribing were introduced and numbers of C. difficile infections gradually fell by 80% but no-one was sure precisely why.
"Our study shows that the C. difficile epidemic was an unintended consequence of intensive use of an antibiotic class, fluoroquinolones, and control was achieved by specifically reducing use of this antibiotic class, because only the C. difficile bugs that were resistant to fluoroquinolones went away.
"Reducing the type of antibiotics like ciprofloxacin was, therefore, the best way of stopping this national epidemic of C. difficile and routine, expensive deep cleaning was unnecessary.
"However it is important that good hand hygiene continues to be practised to control the spread of other infections.
"These findings are of international importance because other regions such as North America, where fluoroquinolone prescribing remains unrestricted, still suffer from epidemic numbers of C. difficile infections."
For the study, published in the journal The Lancet Infectious Diseases, scientists analysed data on C. diff infections and the extent of antibiotic use in hospitals and GP surgeries throughout the UK.
More than 4,000 C. diff bugs were also genetically screened to determine how resistant they were to antibiotics.
Co-author Professor Mark Wilcox, from the University of Leeds, said: "Our results mean that we now understand much more about what really drove the UK epidemic of C. diff infection in the mid-2000s.
"Crucially, part of the reason why some C. diff strains cause so many infections is because they find a way to exploit modern medical practice.
"Similar C. diff bugs that affected the UK have spread around the world, and so it is plausible that targeted antibiotic control could help achieve large reductions in C. diff infections in other countries."