Abstract Objective: Postoperative atrial fibrillation (PoAF) is a common complication after coronary artery bypass grafting (CABG). The aim of the present study was to evaluate the association between development of PoAF and vitamin D levels in patients undergoing isolated CABG. Methods: This prospective randomized clinical trial was conducted on the patients with isolated CABG. The study was terminated when 50 patients in both PoAF(+) group and PoAF(-) group were reached. Development of AF until discharge period was assessed. Vitamin D level was measured immediately after AF; it was measured on the discharge day for the patients without PoAF. Predictive values of the independent variables were measured for the development of PoAF. Results: The groups were separated as PoAF(-) group (66% male, mean age 58.18±10.98 years) and PoAF(+) group (74% male, mean age 61.94±10.88 years). 25(OH) vitamin D level (OR=0.855, 95% CI: 0.780-0.938, P=0.001) and > 65 years (OR=3.525, 95% CI: 1.310-9.483, P=0.013) were identified as an independent predictor of postoperative AF after CABG surgery in multivariate analysis. The cut-off level for 25(OH) vitamin D level in receiver-operating characteristic curve analysis was determined as 7.65 with sensitivity of 60% and specificity of 64% for predicting PoAF (area under the curve: 0.679, P=0.002). Conclusion: Vitamin D level is considered an independent predictor for development of PoAF. Lower vitamin D levels may be one of the reasons for PoAF.