Background. Atrial fibrillation (AF) is one of the most common complications of cardiac surgery. Magnesium, like several other pharmacologic agents, has been used in the prophylaxis of postoperative AF with varying degrees of success. However, the dose and the timing of magnesium prophylaxis need to be clarified. The purpose of this study was to assess the effect of intermittent magnesium infusion on postoperative AF.