BackgroundCommunity-acquired pneumonia (CAP) is a major cause of morbidity and mortality in adults even in developed countries. Several lifestyle factors and comorbidities have been linked to an increased risk, although their prevalence has not been well documented in the primary care setting. The aim of this study is to assess the incidence, risk factor and comorbid conditions distribution of CAP in adults in primary care in Spain.MethodsRetrospective observational study in adults (>18 years-old) with CAP diagnosed and attended at primary care in Spain between 2009 and 2013, using the Computerized Database for Pharmacoepidemiological Studies in Primary Care (BIFAP).ResultsTwenty-eight thousand four hundred thirteen patient records were retrieved and analyzed. Mean age (standard deviation): 60.5 (20.3) years, 51.7 % males. Global incidence of CAP in adults was estimated at 4.63 per 1000 persons/year. CAP incidence increased progressively with age, ranging from a 1.98 at 18–20 years of age to 23.74 in patients over 90 years of age. According to sex, global CAP incidence was slightly higher in males (5.04) than females (4.26); CAP incidence from 18 to 65 year-olds up was comparable between males (range: 2.18–5.75) and females (range: 1.47–5.21), whereas from 65 years of age, CAP incidence was noticeable higher in males (range: 7.06–36.93) than in females (range: 5.43–19.62). Average prevalence of risk factors was 71.3 %, which increased with age, doubling the risk in males by the age of 75 (females 20 % vs males 40 %). From 55 years of age, at least one risk factor was identified in 85.7 % of cases: one risk factor (23.8 %), two risk factors (23.4 %), three or more risk factors (38.5 %). Major risk factors were: metabolic disease (27.4 %), cardiovascular disease (17.8 %) and diabetes (15.5 %).ConclusionsThe annual incidence of CAP in primary care adults in Spain is high, comparable between males and females up to 65 years of age, but clearly increasing in males from that age. CAP risk increases with age and doubles in males older than 75 years. The majority of CAP cases in patients over 55 years of age is associated to at least one risk factor. The main risk factors associated were metabolic disease, cardiovascular disease, and diabetes.Electronic supplementary materialThe online version of this article (doi:10.1186/s12879-016-1974-4) contains supplementary material, which is available to authorized users.