To examine the influence of magnesium (Mg) on hypomagnesaemia and atrial fibrillation (AF) following coronary artery by-pass surgery, 140 consecutive patients were randomized to receive 70 mmol of magnesium sulphate intravenously (n = 69) or placebo (n = 71). Serum magnesium concentrations fell to 0.77 +/- 0.10 mmol.l-1 in the control group but rose to 1.09 +/- 0.17 mmol.l-1 in the Mg group (P < 0.001). The incidence of AF was 29% in the Mg group and 26% in the placebo group (NS). The AF patients were older, more of them had had prior AF episodes, their sinus rates (SR) were slower (78 +/- 10 vs 86 +/- 12 beats.min-1; P < 0.01) and serum Mg concentrations higher (0.89 +/- 0.21 vs 0.80 +/- 0.11 mmol.l-1; P < 0.05). The incidence of AF was 43% in the highest quartile of serum Mg and 23% among the rest (P = 0.056). In patients experiencing AF during the first three post-operative days, serum Mg concentrations were higher and SR slower on each day compared with non-AF patients. SR increased post-operatively less with high Mg levels (P = 0.044). In the Mg group, serum Mg and SR were the only independent predictors of AF. In conclusion, the incidence of post-operative AF is not decreased with magnesium. High Mg levels are likely to provoke AF probably by mechanisms that modify SR.