Researchers found drugs including diazepam and temazepam were linked with a higher risk of developing the lung infection and further studies on their safety was needed.

Patients who were taking the drugs were also more likely to die from pneumonia if they contracted it, it was found.

Around one in ten elderly people are thought to have taken the drugs.

The class of drugs known as benzodiazepines have ‘significant immune effects’ the researchers said and previous concerns raised about patients on intensive care units has led to a reduction of their use in those critically ill people.

Experts said the deep sleep induced by the drugs may mean that secretions can build up in the lungs.

In the study just under 5000 patients who had been diagnosed with pneumonia between 2001 and 2002 were each compared with six similar people, matched for age and sex, and drawn from the same GP practice, who had not been diagnosed with pneumonia.

Having ever taken a benzodiazepine was associated with a 54 percent increased risk of pneumonia and those who did contract it were one fifth more likely to die within a month and a third more likely to die within three years.

The findings showed that current users of the drugs were 90 percent more likely to have contracted pneumonia, recent users who had been prescribed them between one and three months ago were 95 percent more likely to have the infection and past users were 40 percent more likely.

The drugs were also evaluated individually and diazepam, lorazepam and temazepam, but not chlordiazepoxide were associated with an increased risk of pneumonia along with a non-benzodiazepine called zopiclone.

Lead author Eneanya Obiora, of Nottingham University, wrote in the journal: “Benzodiazepines and zopiclone are commonly prescribed medications that have significant immune effects.

“Our data herein suggest that they may increase both the risk of and mortality from pneumonia.

“This is consistent with data from clinical trials and concerns expressed over the intensive care unit effects of these drugs leading to movement away from benzodiazepine sedation.

“Nonetheless, given the widespread use of benzodiazepine drugs, further studies are required to evaluate their safety in the context of infection.”

Benzodiazepines have a wide range of uses and are commonly prescribed for anxiety, epilepsy, muscle spasm, and insomnia. They are also frequently used in palliative care, as a sedative, and to help those with an alcohol problem to “dry out.”

Prof. Donald Singer, member of the British Pharmacological Society and Professor of Clinical Pharmacology at the University of Warwick, said: “This report suggests the need for caution, particularly in the longer term use of benzodiazepines.

“However the authors note that they cannot be sure whether their findings are cause and effect or have other explanations.

“For example, it was puzzling that risks from these drugs appeared lower in patients with more complex disease burden.

“There are also risks to stopping these medicines suddenly so patients with concerns should seek advice from their doctor or pharmacist.”

Prof. Peter Openshaw, Director of the Centre for Respiratory Infection, at Imperial College London, said: “We normally tell patients with chronic bronchitis that they should avoid using sleeping pills since these may cause respiratory suppression and inhibit coughing.”

“The normal reflexes that help to clear secretions from the lungs at night may be inhibited.”

“It seems likely that the effects described in this study are due to deep sleep caused by the drugs.”

“This causes secretions being retained in the lungs, so that bacteria are not cleared so fast and cause infection.”

“This seems more probable than the possible effects of the drugs on the immune system, which may or may not be important. It is also possible that those needing sleeping pills are more prone to pneumonia for other reasons, and that the link is not causal.”

“Whatever the explanation, it’s an interesting paper and important finding.”

Dr. Jodi Lindsay, Reader in Microbial Pathogenesis, at St George’s, University Of London, said: “The study shows an unexpected and intriguing association between benzodiazepines and pneumonia.

“The next step will be to understand why. This could lead to safer anxiety and sedative drugs as well as improving strategies for preventing and treating infections.”

Around two percent of the population in the UK and the USA have taken benzodiazepines for 12 months or more, and among the elderly this prevalence rises to one in 10.

The pneumonia cases were more likely to have had pneumonia before, to have had other serious illness, including a heart attack, depression, and psychotic illness; underlying illnesses; and to be current smokers than those in the comparison group but these factors were taken into account and did not change the findings.