In a broad survey of Drosophila melanogaster population samples, levels of abdominal pigmentation were found to be highly variable and geographically differentiated. A strong positive correlation was found between dark pigmentation and high altitude, suggesting adaptation to specific environments. DNA sequence polymorphism at the candidate gene ebony revealed a clear association with the pigmentation of homozygous third chromosome lines. The darkest lines sequenced had nearly identical haplotypes spanning 14.5 kb upstream of the protein-coding exons of ebony. Thus, natural selection may have elevated the frequency of an allele that confers dark abdominal pigmentation by influencing the regulation of ebony.