Drosophila melanogaster is polymorphic for the major cuticular hydrocarbon of females. In most populations this hydrocarbon is 7,11-heptacosadiene, but females from Africa and the Caribbean usually possess low levels of 7,11-heptacosadiene and high quantities of its position isomer 5,9-heptacosadiene. Genetic analysis shows that the difference between these two morphs is due to variation at a single segregating factor located on the right arm of chromosome 3 near map position 51.5 and cytological position 87C-D. This is precisely the position of a desaturase gene previously sequenced using primers derived from yeast and mouse, and localized by in situ hybridization to the polytene chromosomes of D. melanogaster. Alleles of this desaturase gene may therefore be responsible for producing the two hydrocarbon morphs. Mating tests following the transfer of these isomers between females of the two morphs show that, in contrast to previous studies, the hydrocarbon profiles have no detectable effect on mating behaviour or sexual isolation.