The rising atmospheric concentration of carbon dioxide (CO2) should stimulate ecosystem productivity, but to what extent is highly uncertain, particularly when combined with changing temperature and precipitation. Ecosystem response to CO2 is complicated by biogeochemical feedbacks but must be understood if carbon storage and associated dampening of climate warming are to be predicted. Feedbacks through the hydrological cycle are particularly important and the physiology is well known; elevated CO2 reduces stomatal conductance and increases plant water use efficiency (the amount of water required to produce a unit of plant dry matter). The CO2 response should consequently be strongest when water is limiting; although this has been shown in some experiments, it is absent from many. Here we show that large annual variation in the stimulation of above-ground biomass by elevated CO2 in a mixed C3/C4 temperate grassland can be predicted accurately using seasonal rainfall totals; summer rainfall had a positive effect but autumn and spring rainfall had negative effects on the CO2 response. Thus, the elevated CO2 effect mainly depended upon the balance between summer and autumn/spring rainfall. This is partly because high rainfall during cool, moist seasons leads to nitrogen limitation, reducing or even preventing biomass stimulation by elevated CO2. Importantly, the prediction held whether plots were warmed by 2 °C or left unwarmed, and was similar for C3 plants and total biomass, allowing us to make a powerful generalization about ecosystem responses to elevated CO2. This new insight is particularly valuable because climate projections predict large changes in the timing of rainfall, even where annual totals remain static. Our findings will help resolve apparent differences in the outcomes of CO2 experiments and improve the formulation and interpretation of models that are insensitive to differences in the seasonal effects of rainfall on the CO2 response.