Background: The triglyceride‑glucose (TyG) index is a reliable surrogate of insulin resistance and a marker for ischemic stroke (IS) incident. Whether the TyG index predicts stroke outcome remains uncertain. This study investigated the prognostic value of the TyG index in critically ill stroke patients.Methods: This was a retrospective observational study that included stroke patients, and all data were extracted from the eICU Collaborative Research Database. The TyG index was calculated as the ln (fasting glucose level [mg/dL] × triglyceride level [mg/dL]/2). The outcomes included the hospital and intensive care unit (ICU) death. Multivariate logistic regression was used to determine independent risk factors. The smoothing curves and forest plots were illustrated.Results: A total of 4570 eligible subjects were enrolled. The mean level of TyG index was 9.1 ± 0.7. The hospital and ICU mortality rate were 10.3% and 5.0% respectively. TyG index as a continuous variable was associated hospital mortality in univariate analysis (OR 1.723, 95% CI 1.524-1.948, P < 0.001), adjusted model 1 (OR 1.861, 95% CI 1637-2.116, P < 0.001) and adjusted model 2 (OR 2.543, 95% CI 1.588-4.073, P < 0.001). TyG was also associated ICU mortality in univariate analysis (OR 2.146, 95% CI 1.826-2.523, P < 0.001), adjusted model 1 (OR 2.183, 95% CI 1.847-2.580, P < 0.001), and adjusted model 2 (OR 2.672, 95% CI 1.376-5.188, P < 0.001). The smoothing curves observed a continuous linear association after adjusting all covariates both in hospital and ICU mortality. Subgroup analysis demonstrated TyG index was associated with increased risk of hospital and ICU death in critically ill IS (P < 0.05), but not in hemorrhage stroke (P > 0.05).Conclusion: The TyG index is a potential predictor for hospital and ICU mortality in critically ill stroke patients, especially in IS patients.