Global climate change is predicted to increase the intensity and frequency of future drought, which in turn may be expected to induce a range of biogeochemical climate feedbacks. A combination of model simulations and observational studies of a recent wide-scale drought, suggested that the drought induced substantial terrestrial ecosystem carbon loss, but hypothesized mechanisms could not be evaluated via comparison to a control. Here, we investigated carbon-cycle responses to climate changes by combining results from a controlled 15-year ecosystem warming experiment in montane grassland with observational data from before and during the recent drought. We found that both experimental warming and real-world drought induced substantial soil carbon loss in our study system, and that the same mechanism, a drying-induced shift in plant species composition and an associated decline in community productivity, provides a common explanation for these declines in soil carbon.