Increasing frequency of extreme climatic events can disrupt ecosystem processes and destabilize ecosystem functioning. Biodiversity may dampen these negative effects of environmental perturbations to provide greater ecosystem stability. We assessed the effects of plant diversity on the resistance, recovery and stability of experimental grassland ecosystems in response to recurring summer drought over 7 yr. Plant biomass production was reduced during the summer drought treatment compared with control plots. However, the negative effect of drought was relatively less pronounced at high than at low plant diversity, demonstrating that biodiversity increased ecosystem resistance to environmental perturbation. Furthermore, more diverse plant communities compensated for the reduced productivity during drought by increasing spring productivity compared to control plots. The drought-induced compensatory recovery led to increased short-term variations in productivity across growing seasons in more diverse communities that stabilized the longer-term productivity across years. Our findings show that short-term variation between seasons in the face of environmental perturbation can lead to longer-term stability of annual productivity in diverse ecosystems compared to less diverse ecosystems.