Background: Identifying how greenspace impacts the temperature-mortality relationship in urban environments is crucial, especially given climate change and rapid urbanization. However, the effect modification of greenspace on heat-related mortality has been typically focused on a localized area or single country. This study examined the heat-mortality relationship among different greenspace levels in a global setting. Methods: We collected daily ambient temperature and mortality data for 452 locations in 24 countries and used Enhanced Vegetation Index (EVI) as the greenspace measurement. We used distributed lag non-linear model to estimate the heat-mortality relationship in each city and the estimates were pooled adjusting for city-specific average temperature, city-specific temperature range, city-specific population density, and gross domestic product (GDP). The effect modification of greenspace was evaluated by comparing the heat-related mortality risk for different greenspace groups (low, medium, and high), which were divided into terciles among 452 locations. Findings: Cities with high greenspace value had the lowest heat-mortality relative risk of 1·19 (95% CI: 1·13, 1·25), while the heat-related relative risk was 1·46 (95% CI: 1·31, 1·62) for cities with low greenspace when comparing the 99th temperature and the minimum mortality temperature. A 20% increase of greenspace is associated with a 9·02% (95% CI: 8·88, 9·16) decrease in the heat-related attributable fraction, and if this association is causal (which is not within the scope of this study to assess), such a reduction could save approximately 933 excess deaths per year in 24 countries.