Ecologists have proposed that when interspecific competition is reduced, competition within a species becomes a potent evolutionary force leading to rapid diversification1. This view reflects the observation that populations invading species-poor communities frequently evolve broader niches2. Niche expansion can be associated with an increase in phenotypic variance3,4 (known as character release5), with the evolution of polymorphisms6,7,8,9, or with divergence into many species using distinct resources10,11,12,13 (adaptive radiation). The relationship between intraspecific competition and diversification is known from theory14,15, and has been used as the foundation for some models of speciation16,17,18,19,20. However, there has been little empirical proof that niches evolve in response to intraspecific competition. To test this hypothesis, I introduced cadmium-intolerant Drosophila melanogaster populations to environments containing both cadmium-free and cadmium-laced resources. Here I show that populations experiencing high competition adapted to cadmium more rapidly than low competition populations. This provides experimental confirmation that competition in a population can drive niche expansion onto new resources for which competition is less severe.