Although community-acquired pneumonia (CAP) remains a major cause of hospitalization and death, few studies on risk factors have been performed. A population-based case-control study of risk factors for CAP was carried out in a mixed residential-industrial urban area of 74,610 adult inhabitants in the Maresme (Barcelona, Spain) between 1993 and 1995. All patients living in the area and clinically suspected of having CAP at primary care facilities and hospitals were registered. In total, 205 patients with symptoms, signs and radiographic infiltrate compatible with acute CAP participated in the study. They were matched by municipality, sex and age with 475 controls randomly selected from the municipal census. Risk factors relating the subject's characteristics and habits, housing conditions, medical history and treatments were investigated by means of a questionnaire. In the univariate analysis, an increased risk of CAP was associated with low body mass index, smoking, respiratory infection, previous pneumonia, chronic lung disease, lung tuberculosis, asthma, treated diabetes, chronic liver disease, and treatments with aminophiline, aerosols and plastic pear-spacers. In multivariate models, the only statistically significant risk factors were current smoking of >20 cigarettes x day(-1) (odds ratio (OR)=2.77; 95% confidence interval (CI) 1.14-6.70 compared with never-smokers), previous respiratory infection (OR=2.73; 95% CI 1.75-4.26), and chronic bronchitis (OR=2.22; 95% CI 1.13-4.37). Benzodiazepines were found to be protective in univariate and multivariate analysis (OR=0.46; 95% CI 0.23-0.94). This population-based study provides new and better established evidence on the factors associated with the occurrence of pneumonia in the adult community.