Complementarity and sampling effects may both contribute to increased invasion resistance at higher diversity. We measured plant invader biomass across a long-term experimental plant diversity gradient. Invader species’ biomass was inhibited in more diverse plots, largely because of the presence of strongly competitive C4 bunchgrasses, consistent with a sampling effect. Invader biomass was negatively correlated with resident root biomass, and positively correlated with soil nitrate concentrations, suggesting that competition for nitrogen limited invader success. Resident root biomass increased and soil nitrate concentrations decreased with the presence of C4 grasses and also across the diversity gradient, suggesting that diverse plots are more competitive because of the presence of C4 grasses. In addition to this evidence for a sampling effect, we also found evidence for a complementarity effect. Specifically, the percentage of plots that had lower invader biomass than did the best resident monoculture (i.e. that had invader ‘underyielding’) increased across the species richness gradient. This pattern cannot be explained by a sampling effect and is a unique signature of complementarity effects. Our results demonstrate the importance of multiple mechanisms by which diversity can increase invasion resistance.