Landmark studies have demonstrated the safety and efficacy of implantable cardioverter-defibrillators (ICDs) in selected stable ambulatory patients with heart failure (HF) with a reduced ejection fraction receiving optimal medical therapy. It is not known whether a recent hospitalization for HF before ICD placement is associated with subsequent outcomes. A post hoc analysis was performed of Medicare beneficiaries enrolled in the National Cardiovascular Data Registry’s ICD Registry with a known diagnosis of HF and an ejection fraction ?35% underdoing a new ICD placement for primary prevention. Patients were grouped based on the timing of ICD placement from the last hospitalization for HF. The association between timing of ICD placement and outcomes was assessed by using multivariable logistic regression models. The final analytic cohort included 81?180 patients undergoing initial ICD placement for primary prevention who were currently hospitalized for HF (n=11?563, 14%), hospitalized for HF within 3 months (n=6252, 8%), or hospitalized for HF >3 months previously or had no previous hospitalizations for HF (n=63?365, 78%). Patients currently or recently hospitalized for HF had a higher unadjusted composite periprocedural complication rate (2.60% versus 1.71% versus 1.25%, P<0.001). After adjusting for potential confounders, patients currently hospitalized for HF were at higher risk for death (odds ratio, 2.25; 95% CI, 2.02-2.52; P <0.001) and all-cause readmission (odds ratio, 1.89; 95% CI, 1.79-1.99; P <0.001) at 90 days. Older patients currently or recently hospitalized for HF undergoing initial ICD placement for primary prevention experienced a higher rate of periprocedural complications and were at increased risk of death in comparison with those receiving an ICD without recent HF hospitalization. Additional prospective, real-world, pragmatic, comparative effectiveness studies should be conducted to define the optimal timing of ICD placement.