Speciation involves the evolution of reproductive isolation between populations. One potentially important mechanism is the evolution of pre- or postzygotic isolation between populations as a by-product of adaptation to different environments. In this paper, we tested for assortative mating between allopatric stickleback populations adapted to different ecological niches. Our experimental design controlled for interpopulation interactions and non-adaptive explanations for assortative mating. We found that prezygotic isolation was surprisingly strong: when given a choice, the majority of matings occurred between individuals from similar environments. Our results indicate that the by-product mechanism is a potent source of reproductive isolation, and likely contributed to the origin of sympatric species of sticklebacks.