Abstract. Extreme climatic events, such as droughts and heat stress, induce anomalies in ecosystem–atmosphere CO2 fluxes, such as gross primary production (GPP) and ecosystem respiration (Reco), and, hence, can change the net ecosystem carbon balance. However, despite our increasing understanding of the underlying mechanisms, the magnitudes of the impacts of different types of extremes on GPP and Reco within and between ecosystems remain poorly predicted. Here we aim to identify the major factors controlling the amplitude of extreme-event impacts on GPP, Reco, and the resulting net ecosystem production (NEP). We focus on the impacts of heat and drought and their combination. We identified hydrometeorological extreme events in consistently downscaled water availability and temperature measurements over a 30-year time period. We then used FLUXNET eddy covariance flux measurements to estimate the CO2 flux anomalies during these extreme events across dominant vegetation types and climate zones. Overall, our results indicate that short-term heat extremes increased respiration more strongly than they downregulated GPP, resulting in a moderate reduction in the ecosystem's carbon sink potential. In the absence of heat stress, droughts tended to have smaller and similarly dampening effects on both GPP and Reco and, hence, often resulted in neutral NEP responses. The combination of drought and heat typically led to a strong decrease in GPP, whereas heat and drought impacts on respiration partially offset each other. Taken together, compound heat and drought events led to the strongest C sink reduction compared to any single-factor extreme. A key insight of this paper, however, is that duration matters most: for heat stress during droughts, the magnitude of impacts systematically increased with duration, whereas under heat stress without drought, the response of Reco over time turned from an initial increase to a downregulation after about 2 weeks. This confirms earlier theories that not only the magnitude but also the duration of an extreme event determines its impact. Our study corroborates the results of several local site-level case studies but as a novelty generalizes these findings on the global scale. Specifically, we find that the different response functions of the two antipodal land–atmosphere fluxes GPP and Reco can also result in increasing NEP during certain extreme conditions. Apparently counterintuitive findings of this kind bear great potential for scrutinizing the mechanisms implemented in state-of-the-art terrestrial biosphere models and provide a benchmark for future model development and testing.