Sexual behavior requires animals to distinguish between the sexes and to respond appropriately to each of them. In Drosophila melanogaster, as in many insects, cuticular hydrocarbons are thought to be involved in sex recognition and in mating behavior, but there is no direct neuronal evidence of their pheromonal effect. Using behavioral and electrophysiological measures of responses to natural and synthetic compounds, we show that Z-7-tricosene, a Drosophila male cuticular hydrocarbon, acts as a sex pheromone and inhibits male-male courtship. These data provide the first direct demonstration that an insect cuticular hydrocarbon is detected as a sex pheromone. Intriguingly, we show that a particular type of gustatory neurons of the labial palps respond both to Z-7-tricosene and to bitter stimuli. Cross-adaptation between Z-7-tricosene and bitter stimuli further indicates that these two very different substances are processed by the same neural pathways. Furthermore, the two substances induced similar behavioral responses both in courtship and feeding tests. We conclude that the inhibitory pheromone tastes bitter to the fly. © 2007 Lacaille et al.