SummaryBackgroundAssociations between high and low temperatures and increases in mortality and morbidity have been previously reported, yet no comprehensive assessment of disease burden has been done. Therefore, we aimed to estimate the global and regional burden due to non-optimal temperature exposure.MethodsIn part 1 of this study, we linked deaths to daily temperature estimates from the ERA5 reanalysis dataset. We modelled the cause-specific relative risks for 176 individual causes of death along daily temperature and 23 mean temperature zones using a two-dimensional spline within a Bayesian meta-regression framework. We then calculated the cause-specific and total temperature-attributable burden for the countries for which daily mortality data were available. In part 2, we applied cause-specific relative risks from part 1 to all locations globally. We combined exposure–response curves with daily gridded temperature and calculated the cause-specific burden based on the underlying burden of disease from the Global Burden of Diseases, Injuries, and Risk Factors Study, for the years 1990–2019. Uncertainty from all components of the modelling chain, including risks, temperature exposure, and theoretical minimum risk exposure levels, defined as the temperature of minimum mortality across all included causes, was propagated using posterior simulation of 1000 draws.FindingsWe included 64·9 million individual International Classification of Diseases-coded deaths from nine different countries, occurring between Jan 1, 1980, and Dec 31, 2016. 17 causes of death met the inclusion criteria. Ischaemic heart disease, stroke, cardiomyopathy and myocarditis, hypertensive heart disease, diabetes, chronic kidney disease, lower respiratory infection, and chronic obstructive pulmonary disease showed J-shaped relationships with daily temperature, whereas the risk of external causes (eg, homicide, suicide, drowning, and related to disasters, mechanical, transport, and other unintentional injuries) increased monotonically with temperature. The theoretical minimum risk exposure levels varied by location and year as a function of the underlying cause of death composition. Estimates for non-optimal temperature ranged from 7·98 deaths (95% uncertainty interval 7·10–8·85) per 100 000 and a population attributable fraction (PAF) of 1·2% (1·1–1·4) in Brazil to 35·1 deaths (29·9–40·3) per 100 000 and a PAF of 4·7% (4·3–5·1) in China. In 2019, the average cold-attributable mortality exceeded heat-attributable mortality in all countries for which data were available. Cold effects were most pronounced in China with PAFs of 4·3% (3·9–4·7) and attributable rates of 32·0 deaths (27·2–36·8) per 100 000 and in New Zealand with 3·4% (2·9–3·9) and 26·4 deaths (22·1–30·2). Heat effects were most pronounced in China with PAFs of 0·4% (0·3–0·6) and attributable rates of 3·25 deaths (2·39–4·24) per 100 000 and in Brazil with 0·4% (0·3–0·5) and 2·71 deaths (2·15–3·37). When applying our framework to all countries globally, we estimated that 1·69 million (1·52–1·83) deaths were attributable to non-optimal temperature globally in 2019. The highest heat-attributable burdens were observed in south and southeast Asia, sub-Saharan Africa, and North Africa and the Middle East, and the highest cold-attributable burdens in eastern and central Europe, and central Asia.InterpretationAcute heat and cold exposure can increase or decrease the risk of mortality for a diverse set of causes of death. Although in most regions cold effects dominate, locations with high prevailing temperatures can exhibit substantial heat effects far exceeding cold-attributable burden. Particularly, a high burden of external causes of death contributed to strong heat impacts, but cardiorespiratory diseases and metabolic diseases could also be substantial contributors. Changes in both exposures and the composition of causes of death drove changes in risk over time. Steady increases in exposure to the risk of high temperature are of increasing concern for health.FundingBill & Melinda Gates Foundation.