Patients with congestive heart failure (CHF) often have increased aldosterone activity that leads to hypomagnesemia. Hypomagnesemia can induce arrhythmias, an important cause of death in patients with CHF. We determined whether the aldosterone receptor antagonist spironolactone improved magnesium homeostasis and reduced arrhythmias in patients with CHF. We randomized 116 consecutive patients with CHF into placebo control group (n = 58) and spironolactone group (20 mg daily, n = 58) in addition to conventional therapy. Plasma magnesium concentration (PMC), erythrocyte magnesium concentration (EMC), and erythrocyte magnesium efflux were not different between the 2 groups of patients before treatment. Compared with control patients, patients treated with spironolactone for 6 months had increased PMC and EMC and decreased erythrocyte magnesium efflux. Patients on spironolactone therapy also had a marked decrease of 24-hour mean heart rate, ventricular and atrial premature beats, and the risk of atrial fibrillation/flutter. Pooled data from the 116 patients showed that patients with a higher EMC or a lower sodium-dependent erythrocyte magnesium efflux had a slower heart rate, fewer ventricular premature beats, and a lower risk of atrial fibrillation/flutter. Our results suggest that reducing cellular magnesium efflux and loss may contribute to the spironolactone-reduced arrhythmias in patients with CHF.