BACKGROUND: Climate change threatens human health and general welfare via multiple dimensions. However, the associations of short-term exposure to temperature variability, a crucial aspect of climate change, with myocardial infarction (MI) hospital admissions remains unclear. METHODS AND FINDINGS: This population-based nationwide study employed a time-stratified, case-crossover design to investigate the association between ambient temperature variability and MI hospital admissions among 233,617 patients recorded in the SWEDEHEART registry in Sweden between 2005 and 2019. High-resolution (1 × 1 km) daily mean ambient temperature was assigned to patients' residential areas. Temperature variability was calculated as the difference between the same-day (as the MI event) ambient temperature and the average temperature over the preceding 7 days. An upward temperature shift represents a rise in the current day's temperature relative to the 7-day average, while a downward temperature shift indicates a corresponding decrease. A conditional logistic regression model with distributed lag non-linear model was applied to estimate the association between ambient temperature variability and total MI (encompassing all MI types), ST-segment elevation myocardial infarction (STEMI) and non-ST-segment elevation myocardial infarction (NSTEMI) hospital admissions at lag 0-6 days. Potential effect modifiers, such as sex, history of diseases, and season, were also examined. The patients had an average age of 70.6 years, and 34.5% of them were female. Our study found that an upward temperature shift was associated with increased risks of total MI (encompassing all MI types), STEMI, and NSTEMI hospital admissions at lag 0 day, with odds ratios (OR, 95% confidence intervals [CIs]) of 1.009 (1.005, 1.013; p < 0.001), 1.014 (1.006, 1.022; p < 0.001), and 1.007 (1.001, 1.012; p = 0.014) per 1 °C increase, respectively. These associations attenuated and became non-significant over lags 1-6 days. Furthermore, a downward temperature shift was associated with increased risks of hospital admissions for total MI (encompassing all MI types) at a lag of 2 days with an OR (95% CI): 1.003 (1.001, 1.005; p = 0.014), and for STEMI at lags 2 and 3 days with ORs (95% CI): 1.006 (1.002, 1.010; p = 0.001) and 1.005 (1.001, 1.008; p = 0.011), per 1 °C decrease, respectively. Conversely, higher downward temperature shifts were associated with decreased risks of total MI (encompassing all MI types) and NSTEMI at lag 0 day. No significant associations were observed at other lag days for downward temperature shifts. Males and patients with diabetes had higher MI hospitalization risks from upward temperature shift exposure, while downward temperature shift exposure in cold seasons posed greater MI hospitalization risks. A methodological limitation was the use of ambient temperature variability as a proxy for personal exposure, which, while practical for large-scale studies, may not precisely reflect individual temperature exposure. CONCLUSIONS: This nationwide study contributes insights that short-term exposures to higher temperature variability-greater upward or downward temperature shifts-are associated with an increased risk of MI hospitalization. Our finding highlights the cardiovascular health threats posed by higher temperature variability, which are anticipated to increase in frequency and intensity due to climate change.