Background Pulmonary embolism (PE) patients combined with heart failure (HF) have been reported to have a high short-term mortality. However, few studies have developed predictive tools of 30-day mortality for these patients in intensive care unit (ICU). This study aimed to construct and validate a machine learning (ML) model to predict 30-day mortality for PE patients combined with HF in ICU. Methods We enrolled patients with PE combined with HF in the Medical Information Mart for Intensive Care Database (MIMIC) and developed six ML models after feature selection. Further, eICU Collaborative Research Database (eICU-CRD) was utilized for external vali- dation. The area under curves (AUC), calibration curves, decision curve analysis (DCA), net reclassification improvement (NRI), and integrated discrimination improvement (IDI) were performed to evaluate the prediction performance. Shapley additive explanation (SHAP) was performed to enhance the interpretability of our models. Results A total of 472 PE patients combined with HF were included. We developed six ML models by the 13 selected features. After internal validation, the Support Vector Ma- chine (SVM) model performed best with an AUC of 0.835, a superior calibration degree, and a wider risk threshold (from 0% to 90%) for obtaining clinical benefit, which also outperformed traditional mortality risk evaluation systems,as evaluated by NRI and IDI. The SVM model was still reliable after external validation. SHAP was performed to explain the model. Moreover, an online application was developed for further clinical use. Conclusion This study developed a potential tool for identify short-term mortality risk to guide clinical decision making for PE patients combined with HF in the ICU. The SHAP method also helped clinicians to better understand the model.