BackgroundType 2 diabetes mellitus (DM) is a risk factor for mycobacterial pulmonary infections (MPI), including tuberculosis (TB) and nontuberculous mycobacterial lung disease (NTM-LD). Dipeptidyl peptidase IV inhibitor (DPP4i), a common DM medication, has an immune-modulation effect that raises concerns about developing MPI. However, there is scarce research on the topic. MethodsThis retrospective study was conducted in a tertiary-referral center in Taiwan from 2009 to 2016. Patients with type 2 DM who were receiving any DM medication were enrolled. TB and NTM-LD were defined by microbiological criteria. We analyzed the risk of MPI in DPP4i users using Cox proportional hazard regression with adjusted inverse probability of treatment weighting. ResultsA total of 9963 patients were included. Among them, 3931 were classified as DPP4i users, and 6032 patients were DPP4i nonusers. DPP4i users had no increase in incidences of MPI (604 vs. 768 per 100,000 person-years, p = 0.776), NTM-LD (174 vs. 255 per 100,000 person-years, p = 0.228), and TB (542 vs. 449 per 100,000 person-years, p = 0.663) relative to those of DPP4i nonusers. After adjustment, the adjusted hazard ratios for MPI (aHR: 1.07, 95% CI: 0.79–1.45), TB (aHR: 1.15, 95% CI: 0.81–1.64) and NTM-LD (aHR: 0.85, 95% CI: 0.49–1.47) were not significantly increased relative to those of nonusers. The subgroup analysis also showed that DPP4i use did not increase the risk of MPI in different DM severities and comorbidities. ConclusionsAccording to our large cohort study, DPP4i use is safe for patients with type 2 DM and might not increase the risk of MPI.