Overall, 1,642,875 hospitalized surgical patients (65.4% females, 49.5% aged >70 years) were included in the analysis. Of these, 93,748 patients (5.7%) were diagnosed with AF. Overall, 0.1% of the patients who underwent KES and 0.6% of the patients who underwent KES with additional AF died during in-hospital stay. All-cause death (risk ratio 5.97 [95% confidence interval {CI} 5.41-6.58], P < .001) and adverse in-hospital events (risk ratio 2.62 [95% CI 2.50-2.74], P < .001) occurred both more often in patients with AF compared to those without. AF was an important predictor for in-hospital death (odds ratio 2.09 [95% CI 1.88-2.32], P < .001) and adverse in-hospital events (odds ratio 1.76 [95% CI 1.68-1.85], P < .001) in patients who underwent KES independent of age, sex, and comorbidities.