Aims: The aim of this study was to investigate the association between early percutaneous coronary intervention (PCI) and pneumonia risk in patients with acute myocardial infarction (AMI) by using Taiwan's National Health Insurance Research Database (NHIRD). Methods and results: In total, 4,732 patients with non-ST-elevation myocardial infarction (NSTEMI) and 5,465 with ST-elevation myocardial infarction (STEMI) who had received PCI during AMI hospitalisation (early PCI) were evaluated. Patients who did not receive PCI during AMI hospitalisation (deferred PCI) were matched through propensity score matching. The incidence rates (per 100 person-months) of pneumonia hospitalisation, pneumonia-related respiratory failure, and pneumonia-related death associated with early PCI in patients with NSTEMI were 0.36 (95% confidence interval [CI]: 0.32-0.42), 0.12 (95% CI: 0.10-0.16), and 0.08 (95% CI: 0.06-0.11), respectively. In patients with STEMI, the incidence rates (per 100 person-months) of the aforementioned adverse events were 0.16 (95% CI: 0.13-0.20), 0.04 (95% CI: 0.03-0.06), and 0.02 (95% CI: 0.01-0.04), respectively. After adjustment for patients' clinical variables, early PCI was associated with reduced risks of pneumonia hospitalisation (adjusted hazard ratio [aHR] 0.54, 95% CI: 0.43-0.68, p<0.001), pneumonia-related respiratory failure (aHR 0.54, 95% CI: 0.35-0.84, p=0.006), and pneumonia-related death (aHR 0.29, 95% CI: 0.17-0.52, p<0.001) in patients with NSTEMI. In patients with STEMI, early PCI was beneficial for pneumonia hospitalisation (aHR 0.62, 95% CI: 0.45-0.86, p=0.004). Conclusions: Early PCI might reduce the risk of pneumonia hospitalisation in patients with AMI.