Atrial fibrillation is common in patients with heart failure, but outcomes of patients with both conditions who receive cardiac resynchronization therapy with defibrillator (CRT-D) compared with an implantable cardioverter-defibrillator (ICD) alone are unclear.Using the National Cardiovascular Data Registry's ICD Registry linked with Medicare claims, we identified 8951 patients with atrial fibrillation who were eligible for CRT-D and underwent first-time device implantation for primary prevention between April 2006 and December 2009. We used Cox proportional hazards models and inverse probability-weighted estimates to compare outcomes with CRT-D versus ICD alone. Cumulative incidence of mortality (744 [33%] for ICD; 1893 [32%] for CRT-D) and readmission (1788 [76%] for ICD; 4611 [76%] for CRT-D) within 3 years and complications within 90 days were similar between groups. After inverse weighting for the probability of receiving CRT-D, risks of mortality (hazard ratio, 0.83; 95% confidence interval, 0.75-0.92), all-cause readmission (hazard ratio, 0.86; 95% confidence interval, 0.80-0.92), and heart failure readmission (hazard ratio, 0.68; 95% confidence interval, 0.62-0.76) were lower with CRT-D compared with ICD alone. There was no significant difference in the 90-day complication rate (hazard ratio, 0.88; 95% confidence interval, 0.60-1.29). We observed hospital-level variation in the use of CRT-D among patients with atrial fibrillation.Among eligible patients with heart failure and atrial fibrillation, CRT-D was associated with lower risks of mortality, all-cause readmission, and heart failure readmission, as well as with a similar risk of complications compared with ICD alone.