BackgroundST-segment elevation myocardial infarction (STEMI) patients are at a high residual risk of major adverse cardiovascular events (MACEs) after revascularization. Risk factors modify prognostic risk in distinct ways in different STEMI subpopulations. We developed a MACEs prediction model in patients with STEMI and examined its performance across subgroups.MethodsMachine-learning models based on 63 clinical features were trained in patients with STEMI who underwent PCI. The best-performing model (the iPROMPT score) was further validated in an external cohort. Its predictive value and variable contribution were studied in the entire population and subgroups.ResultsOver 2.56 and 2.84 years, 5.0% and 8.33% of patients experienced MACEs in the derivation and external validation cohorts, respectively. The iPROMPT score predictors were ST-segment deviation, brain natriuretic peptide (BNP), low-density lipoprotein cholesterol (LDL-C), estimated glomerular filtration rate (eGFR), age, hemoglobin, and white blood cell (WBC) count. The iPROMPT score improved the predictive value of the existing risk score, with an increase in the area under the curve to 0.837 [95% confidence interval (CI): 0.784–0.889] in the derivation cohort and 0.730 (95% CI: 0.293–1.162) in the external validation cohort. Comparable performance was observed between subgroups. The ST-segment deviation was the most important predictor, followed by LDL-C in hypertensive patients, BNP in males, WBC count in females with diabetes mellitus, and eGFR in patients without diabetes mellitus. Hemoglobin was the top predictor in non-hypertensive patients.ConclusionThe iPROMPT score predicts long-term MACEs following STEMI and provides insights into the pathophysiological mechanisms for subgroup differences.