Background Dipeptidyl-peptidase-4 inhibitors (DPP4Is) are drugs for the treatment of type 2 diabetes mellitus (T2DM). There is increasing evidence that DPP4Is may result in suppression of the immune system and may increase the risk of infections such as pneumonia. Aim of this study was to evaluate the association between the use of DPP4Is and the risk of pneumonia in a population-based study. Methods We conducted a population-based cohort study using data from the world's largest primary care database, the UK Clinical Practice Research Datalink (CPRD). We selected all users of non-insulin antidiabetic drugs (NIADs), including DPP4Is, between 2007 and 2012. To each NIAD user, we matched randomly selected non-users. The NIAD user's first prescription defined the index date, which was then assigned to the matched non-users. Patients were followed from their first prescription until end of data collection or the first event of pneumonia, whichever came first. Cox regression analysis estimated the association between pneumonia and current use of DPP4Is versus 1) current use of other NIADs and 2) non-users. DPP4I use was then stratified to daily and cumulative dose. Analyses were statistically adjusted for age, sex, lifestyle factors and comorbidities and concomitant use of various other drugs. Results Risk of pneumonia was not increased with current DPP4I use versus use of other NIADs, adjusted Hazard Ratio (HR) 0.70; 95% Confidence Interval (CI) 0.55-0.91. Also higher cumulative doses or daily doses did not further increase risk of pneumonia. Conclusion We found no increased risk of pneumonia in T2DM patients using DPP4Is compared to T2DM patients using other NIADs. Our finding is in line with direct and indirect evidence from observational studies and RCTs. There is probably no need to avoid prescribing of DPP4Is to elderly patients who are at risk of pneumonia.