Background: The incidence of postoperative sepsis is continually increased, while few studies have specifically focused on the risk factors and clinical outcomes associated with the development of sepsis after surgical procedures. The present study aimed to develop a mathematical model for predicting the in-hospital mortality among patients with postoperative sepsis.Methods: Surgical patients in Medical Information Mart for Intensive Care (MIMIC-III) database who simultaneously fulfilled Sepsis 3.0 as well as Agency for Healthcare Research and Quality (AHRQ) criteria during ICU admission were incorporated. We employed both extreme gradient boosting (XGBoost) and stepwise logistic regression model to predict in-hospital mortality among included patients with postoperative sepsis. Consequently, model performance was assessed from the angles of discrimination and calibration.Results: We included 3713 patients who fulfilled our inclusion criteria, in which 397 (10.7%) patients died during hospitalization, while 3316 (89.3%) of them survived through discharge. Fluid-electrolyte disturbance, coagulopathy, renal replacement therapy (RRT), urine output, and cardiovascular surgery were important features related to the in-hospital mortality. The XGBoost model had a better performance in both discriminatory ability (c-statistics, 0.835 [95% CI, 0.786 to 0.877] vs. c-statistics, 0.737 [95% CI, 0.688 to 0.786]) and goodness of fit (visualized by calibration curve) compared to the stepwise logistic regression model. Conclusion: XGBoost model appears to be a better performance in predicting hospital mortality among postoperative septic patients compared to the conventional stepwise logistic regression model. Machine learning-based algorithm might have significant application in the development of early warning system for septic patients following major operations.