Background: This study aimed to evaluate the performance of machine learning algorithms using lactate and arterial blood gas parameters to predict the imminent risk of death in extremely low birth weight infants. Methods: A retrospective cohort study analyzing preterm infants with birth weight less than 1000 grams in a single-center tertiary neonatal intensive care unit in São Paulo, Brazil, between 2012 and 2017 was carried out. We included all infants with at least one arterial blood gas analysis with paired serum lactate. To assess 24-hour mortality risk, we conducted three machine learning algorithms (Logistic Regression, Extreme Gradient Boosting, and AutoML Tables). Results: We analyzed 1932 blood gas samples with matched lactate measurements. Our study population had a median gestational age of 27.1 (26 – 29.1) weeks and a median birth weight of 746 (600 – 880) grams. The Extreme Gradient Boosting model with lactate achieved the highest area under the receiver operating characteristic (AUROC) of 0.898. Base excess, lactate, and pH were, in order of importance, the most important features associated with 24-hour mortality. Conclusions: Incorporating lactate and blood gas samples into real-time mortality predictive models may aid to identify those preterm infants with a higher risk of death.