BackgroundSurvivors of common infections may develop cognitive impairment or dementia; however, the risk of these conditions in people hospitalised with pneumonia is not well established.MethodsA matched cohort study was conducted using Hospital Episode Statistics (HES) data linked to the Clinical Practice Research Database (CPRD). Adults with the first International Classification of Diseases (10th Revision) code for pneumonia recorded in the HES between 1 July 2002 and 30 June 2017 were included, and up to four controls without hospitalisation for pneumonia in the CPRD were matched by sex, age and practice. Cognitive impairment and dementia incidence rates were calculated and survival analysis was performed comparing those hospitalised with pneumonia to the general population.ResultsThe incidence rates of cognitive impairment and dementia were 18 (95% CI 17.3–18.7) and 13.2 (95% CI 13–13.5) per 1000 person-years among persons previously hospitalised with pneumonia and the matched cohort respectively. People previously hospitalised with pneumonia had 53% higher incidence of cognitive impairment and dementia (adjusted hazard ratio (aHR) 1.53, 95% CI 1.46–1.61) than their matched cohort. The highest incidence was observed within 1 year of hospitalisation for pneumonia compared to the general population (aHR 1.89, 95% CI 1.75–2.05). Age modified the effect of hospitalisation for pneumonia on cognitive impairment and dementia such that the size of effect was stronger in people between 45 and 60 years old (p-value for interaction <0.0001).ConclusionCognitive impairment and dementia are more likely to be diagnosed in people who have been hospitalised for pneumonia, especially in the first year after discharge, than in the general population.