Objective We aimed to examine the risk factors and prognosis of nosocomial pneumonia (NP) during extracorporeal membrane oxygenation (ECMO). Methods We retrospectively analyzed data of patients who received ECMO at the Affiliated Hangzhou Hospital of Nanjing Medical University between January 2013 and August 2019. The primary outcome was the survival-to-discharge rate. Results Sixty-nine patients who received ECMO were enrolled, median age 42 years and 26 (37.7%) women; 14 (20.3%) patients developed NP. The NP incidence was 24.7/1000 ECMO days. Patients with NP had a higher proportion receiving veno-venous (VV) ECMO (50% vs. 7.3%); longer ECMO support duration (276 vs. 140 hours), longer ventilator support duration before ECMO weaning (14.5 vs. 6 days), lower ECMO weaning success rate (50.0% vs. 81.8%), and lower survival-to-discharge rate (28.6% vs. 72.7%) than patients without NP. Multivariable analysis showed independent risk factors that predicted NP during ECMO were ventilator support duration before ECMO weaning (odds ratio [OR] = 1.288; 95% confidence interval [CI]: 1.111–1.494) and VV ECMO mode (OR = 10.970; 95% CI: 1.758–68.467). Conclusion NP during ECMO was associated with ventilator support duration before ECMO weaning and VV ECMO mode. Clinicians should shorten the respiratory support duration for patients undergoing ECMO to prevent NP.