Population expansions trigger many biomedical and ecological transitions, from tumor growth to invasions of non-native species. Although population spreading often selects for more invasive phenotypes, we show that this outcome is far from inevitable. In cooperative populations, mutations reducing dispersal have a competitive advantage. Such mutations then steadily accumulate at the expansion front, bringing invasion to a halt. Our findings are a rare example of evolution driving the population into an unfavorable state, and they could lead to new strategies to combat unwelcome invaders.