Abstract
Background: Climate change is increasing the frequency and severity of heatwaves, raising risks to population health. These trends highlight the need for early-warning systems that can anticipate heat-related impacts and support timely public health action. In Portugal, the national heat warning system effectively triggers national alerts but does not account for differences in risk between municipalities.Methods: We conducted a nationwide ecological retrospective study using a hybrid statistical–machine learning framework to downscale heat-related mortality risk across all municipalities in Portugal. Associations between extreme heat and mortality were estimated using a Generalized Linear Mixed Model with random intercepts per municipality and random slopes for extreme heat, robustness and predictive performance were evaluated using GPBoost, a machine learning method combining gradient-boosted decision trees with Gaussian process–based random effects.Findings: Extreme heat was associated with a 14.7% increase in mortality on extreme heat days (incidence rate ratio 1.147, 95% CI 1.133–1.161; p<0.001). Nearly half of the total variance in mortality (47%) was attributable to between-municipality differences, stressing the need for spatially resolved modelling. These results were validated by machine-learning, which estimated an 11.82% relative increase in mortality associated with extreme heat.Interpretation: By integrating formal statistical inference with machine-learning validation, this study demonstrates that reliable, policy-relevant downscaling of heat-related mortality risk is both feasible and essential at national scale. This framework is replicable to other countries, supporting the development of high-resolution heat–health warning systems and more targeted public health interventions to reduce the escalating health burden of extreme heat.