The nature of genetic variation for Drosophila longevity in a population of recombinant inbred lines was investigated by estimating quantitative genetic parameters and mapping quantitative trait loci (QTL) for adult life span in five environments: standard culture conditions, high and low temperature, and heat-shock and starvation stress. There was highly significant genetic variation for life span within each sex and environment. In the analysis of variance of life span pooled over sexes and environments, however, the significant genetic variation appeared in the genotype x sex and genotype x environment interaction terms. The genetic correlation of longevity across the sexes and environments was not significantly different from zero in these lines. We estimated map positions and effects of QTL affecting life span by linkage to highly polymorphic roo transposable element markers, using a multiple-trait composite interval mapping procedure. A minimum of 17 QTL were detected; all were sex and/or environment-specific. Ten of the QTL had sexually antagonistic or antagonistic pleiotropic effects in different environments. These data provide support for the pleiotropy theory of senescence and the hypothesis that variation for longevity might be maintained by opposing selection pressures in males and females and variable environments. Further work is necessary to assess the generality of these results, using different strains, to determine heterozygous effects and to map the life span QTL to the level of genetic loci.