Male secondary sexual traits may increase the risk of predation because mating signals make them conspicuous to predators and hamper evasive manoeuvres. Males of Xenotoca variata, a viviparous freshwater fish, show on their flanks bright and colourful spots (speckles), the number of which varies geographically. In this study, the association of this variation with the presence of the piscivorous snake Thamnophis melanogaster, which co-occurs with X. variata, was investigated. A test was also done to establish whether the snake distinguishes between male fish with contrasting numbers of speckles and if the perception of speckles is influenced by water turbidity. The amount of speckling and the prevalence of snakes in key localities was assessed by using one-way mirrors, and the effect of speckles on the predatory responsiveness of snakes was evaluated by presenting them with pairs of male fish in clear and in turbid water. In localities where snakes were infrequent there was a tendency for male fish to have many speckles. The snakes preferentially approached the males with more speckles than the males with fewer speckles. The direction of the preference did not change with the conditions of the water, but the magnitude was stronger in clear water than in turbid water. The snakes also approached first the males with more speckles. These findings indicate that predation risk by T. melanogaster may select against speckles and produce population differentiation.