Background: Long-term use of proton-pump inhibitors (PPI) can result in hypomagnesemia and arrhythmia. This study aimed to compare the effect of PPI and histamine 2-receptor antagonists (H2 RA) on the incidence of hypomagnesemia and arrhythmia in patients following off-pump coronary artery bypass surgery (CABG). Method: In this randomized-controlled clinical trial 290 patients admitted to the ICU after off-pump CABG were randomly divided into two groups of H2 RA (n=145) and PPI (n=145). For patients in the H2 RA group, 50 mg intravenous ranitidine was prescribed every 8 hours after the nothing by mouth (NPO) period, followed by 40 mg famotidine tablets after starting the oral regimen (PO). The PPI group received 40 mg pantozol IV injections every 12 hours during the NPO period and 40 mg pantozol tablets once daily after becoming PO. The patients were investigated for the development of hypomagnesemia and associated arrhythmia. Results: In total 271 patients with a mean age of 59.3±10 years completed the study (female/male=32.8%). Hypomagnesemia occurred in 60.1% of the patients, 76 (56.7%) in the H2 RA group and 87 (63.5%) in the PPI group (P=0.245), whereas arrhythmia had a prevalence of 12 (9.6%) and 15 (11.1%) cases, respectively (P=0.690). The mean time of occurrence of hypomagnesemia and arrhythmia was 1.75±1.08 and 3.0±0.9 days after the operation in the H2 RA group (P=0.111) and 1.47±0.7 and 2.9±1.5 days in the PPI group (P=0.897), respectively. Conclusion: Our study revealed that the short-term use of PPIs does not result in higher rates of hypomagnesemia and associated arrhythmia in comparison to H2 RA consumption after off-pump CABG.