Heart failure is often complicated by atrial fibrillation. Once atrial fibrillation has started it further enhances heart failure due to uncontrolled rate with shortened filling time and provocation of tachycardiomyopathy. Absent atrial kick and irregularity of the ventricular rhythm also contribute. Considering these mechanisms, restoration of sinus rhythm is most beneficial but is associated with frequent recurrences. Before cardioversion heart failure must be treated. ACE inhibition, initiated before cardioversion, may enhance maintenance of sinus rhythm by reducing neurohumoral activation. As a consequence, arrhythmogenic factors diminish and ventricular function may improve. beta-blockade and amiodarone may have similar effects. If cardioversion fails, adequate rate control is mandatory to prevent progressive ventricular dysfunction. Digitalis is the treatment of first choice, but when the heart rate remains uncontrolled low-dose beta-blockade should be given. If the ventricular rate remains uncontrolled despite drugs, atrioventricular node ablation with implantation of a pacemaker may be considered. Not only patients with idiopathic heart failure and atrial fibrillation, but also those with significant underlying heart disease may benefit from this intervention. In atrial fibrillation patients undergoing cardiac surgery for heart failure due to valvular disease, additional arrhythmia surgery may be contemplated.