Recommendations on cardiac resynchronization therapy (CRT) in patients with atrial fibrillation or flutter (AF) are based on less robust evidence than those in sinus rhythm (SR). We aimed to assess the efficacy of CRT upgrade in the BUDAPEST-CRT Upgrade trial population by their baseline rhythm. Heart failure patients with reduced ejection fraction (HFrEF) and previously implanted pacemaker (PM) or implantable cardioverter defibrillator (ICD) and ≥20% right ventricular (RV) pacing burden were randomized to CRT with defibrillator (CRT-D) upgrade (n = 215) or ICD (n = 145). Primary [HF hospitalization (HFH), all-cause mortality, or <15% reduction of left ventricular end-systolic volume] and secondary outcomes were investigated. At enrolment, 131 (36%) patients had AF, who had an increased risk for HFH as compared with those with SR [adjusted hazard ratio (aHR) 2.99; 95% confidence interval (CI) 1.26–7.13; P = 0.013]. The effect of CRT-D upgrade was similar in patients with AF as in those with SR [AF adjusted odds ratio (aOR) 0.06; 95% CI 0.02–0.17; P < 0.001; SR aOR 0.13; 95% CI 0.07–0.27; P < 0.001; interaction P = 0.29] during the mean follow-up time of 12.4 months. Also, it decreased the risk of HFH or all-cause mortality (aHR 0.33; 95% CI 0.16–0.70; P = 0.003; interaction P = 0.17) and improved the echocardiographic response (left ventricular end-diastolic volume difference −49.21 mL; 95% CI −69.10 to −29.32; P < 0.001; interaction P = 0.21). In HFrEF patients with AF and PM/ICD with high RV pacing burden, CRT-D upgrade decreased the risk of HFH and improved reverse remodelling when compared with ICD, similar to that seen in patients in SR. In AF patients CRT-D upgrade reduced the risk of mortality or HF hospitalization as compared with ICD, additionally echocardiographic parameters, symptoms, and NT-proBNP levels improved. However, the risk of HF hospitalization was higher in AF patients when compared with SR. AF, atrial fibrillation or flutter; aOR, adjusted odds ratio; aHR, adjusted hazard ratio; CI, confidence interval; CRT-D, cardiac resynchronization therapy with defibrillator; ICD, implantable cardioverter defibrillator; HF, heart failure; HFrEF, heart failure with reduced ejection fraction; LVESV, left ventricular end-systolic volume; NT-proBNP, N-terminal pro b-type natriuretic peptide; PCI, percutaneous coronary intervention; PM, pacemaker; RV, right ventricular; SR, sinus rhythm.