Sexual selection may facilitate speciation because it can cause rapid evolutionary diversification of male mating signals and female preferences. Divergence in these traits can then contribute to reproductive isolation. The sensory drive hypothesis predicts that three mechanisms underlie divergence in sexually selected traits: (1) habitat-specific transmission of male signals; (2) adaptation of female perceptual sensitivity to local ecological conditions; and (3) matching of male signals to female perceptual sensitivity. I test these mechanisms in threespine sticklebacks (Gasterosteus spp.) that live in different light environments. Here I show that female perceptual sensitivity to red light varies with the extent of redshift in the light environment, and contributes to divergent preferences. Male nuptial colour varies with environment and is tuned to female perceptual sensitivity. The extent of divergence among populations in both male signal colour and female preference for red is correlated with the extent of reproductive isolation in these recently diverged species. These results demonstrate that divergent sexual selection generated by sensory drive contributes to speciation.