The benefits of plant functional group and plant species diversity for sustaining primary productivity have been extensively studied. However, few studies have simultaneously explored potential benefits of plant species and functional group richness and composition for the delivery of other ecosystem services and their dependency on resource availability. Here, we investigated in soils of different fertility the effects of plant species and functional group richness and composition on carbon (C) and nitrogen (N) stocks in vegetation, soil and soil microbes and on CO2 exchange and the loss of C and N from soil through leaching. We established plant communities from a pool of six mesotrophic grassland species belonging to one of three functional groups (C3 grasses, forbs and legumes) in two soils of contrasting fertility. We varied species richness using one, two, three or six species and one, two or three functional groups. After 2 years, vegetation C and N and soil microbial biomass were greater in the more fertile soil and increased significantly with greater numbers of plant species and functional group richness. The positive effect of plant diversity on vegetation C and N coincided with reduced loss of water and N through leaching, which was especially governed by forbs, and increased rates of net ecosystem CO2 exchange. Soil C and N pools were not affected by the number of plant species or functional group richness per se after 2 years, but were enhanced by the presence and biomass of the legumes Lotus corniculatus and Trifolium repens. Synthesis. Collectively, our findings indicate that changes in plant species and functional group richness influence the storage and loss of both C and N in model grassland communities but that these responses are related to the presence and biomass of certain plant species, notably N fixers and forbs. Our results therefore suggest that the co-occurrence of species from specific functional groups is crucial for the maintenance of multifunctionality with respect to C and N storage in grasslands. © 2009 British Ecological Society.