Abstract Background: Arrhythmias following cardiac surgery is still a difficult complication to treat. Magnesium sulfate is an effective antiarrhythmic agent with negligible side effects. In this study, effects of magnesium sulfate as a first line antiarrhythmic agent was compared with results of two different well-accepted antiarrhythmic agents. Methods: One hundred patients with arrhythmia were prospectively randomized to a study and a control group. Lidocaine and amiodarone were accepted as standard antiarrhythmic agents. Patients in study group were received magnesium sulfate routinely as a first line antiarrhythmic agent. Unresponsive arrhythmias were treated with standard antiarrhythmic agents. Control group patients received only standard antiarrhythmics. Results: Magnesium sulfate alone was effective in 56% of the study group whereas 74% of the control group were responsive to standard antiarrhythmics ( P=n.s.). In study group, a subgroup analysis according to blood levels of Mg 2+ revealed that magnesium sulfate was more effective in patients with low Mg 2+ levels (63% for low Mg 2+ levels, 55% for normal Mg 2+ levels, 36% for high Mg 2+ levels) and ventricular arrhythmias (60% for ventricular and 40% for supraventricular arrhythmias), without statistical significance. Conclusions: Magnesium sulfate is an effective and safe antiarrhythmic agent for arrhythmias developed after open-heart surgery. Its antiarrhythmic effect may relate to its pharmacological properties and unrelated to normalization of the circulating magnesium concentrations. We recommend its use as a first line antiarrhythmic agent without routine measurement of blood levels.