ImportanceCardiac implantable electronic device (CIED) infection is a potentially devastating complication with an estimated 12-month mortality of 15% to 30%. The association of the extent (localized or systemic) and timing of infection with all-cause mortality has not been established.ObjectiveTo evaluate the association of the extent and timing of CIED infection with all-cause mortality.Design, Setting, and ParticipantsThis prospective observational cohort study was conducted between December 1, 2012, and September 30, 2016, in 28 centers across Canada and the Netherlands. The study included 19 559 patients undergoing CIED procedures, 177 of whom developed an infection. Data were analyzed from April 5, 2021, to January 14, 2023.ExposuresProspectively identified CIED infections.Main Outcomes and MeasuresTime-dependent analysis of the timing (early [≤3 months] or delayed [3-12 months]) and extent (localized or systemic) of infection was performed to determine the risk of all-cause mortality associated with CIED infections.ResultsOf 19 559 patients undergoing CIED procedures, 177 developed a CIED infection. The mean (SD) age was 68.7 (12.7) years, and 132 patients were male (74.6%). The cumulative incidence of infection was 0.6%, 0.7%, and 0.9% within 3, 6, and 12 months, respectively. Infection rates were highest in the first 3 months (0.21% per month), reducing significantly thereafter. Compared with patients who did not develop CIED infection, those with early localized infections were not at higher risk for all-cause mortality (no deaths at 30 days [0 of 74 patients]: adjusted hazard ratio [aHR], 0.64 [95% CI, 0.20-1.98]; P = .43). However, patients with early systemic and delayed localized infections had an approximately 3-fold increase in mortality (8.9% 30-day mortality [4 of 45 patients]: aHR, 2.88 [95% CI, 1.48-5.61]; P = .002; 8.8% 30-day mortality [3 of 34 patients]: aHR, 3.57 [95% CI, 1.33-9.57]; P = .01), increasing to a 9.3-fold risk of death for those with delayed systemic infections (21.7% 30-day mortality [5 of 23 patients]: aHR, 9.30 [95% CI, 3.82-22.65]; P < .001).Conclusions and RelevanceFindings suggest that CIED infections are most common within 3 months after the procedure. Early systemic infections and delayed localized infections are associated with increased mortality, with the highest risk for patients with delayed systemic infections. Early detection and treatment of CIED infections may be important in reducing mortality associated with this complication.