Longevity is influenced by genetic and environmental factors. The brain's dopamine system may be particularly relevant, since it modulates traits (e.g., sensitivity to reward, incentive motivation, sustained effort) that impact behavioral responses to the environment. In particular, the dopamine D4 receptor (DRD4) has been shown to moderate the impact of environments on behavior and health. We tested the hypothesis that the DRD4 gene influences longevity and that its impact is mediated through environmental effects. Surviving participants of a 30-year-old population-based health survey (N = 310; age range, 90-109 years; the 90+ Study) were genotyped/resequenced at the DRD4 gene and compared with a European ancestry-matched younger population (N = 2902; age range, 7-45 years). We found that the oldest-old population had a 66% increase in individuals carrying the DRD4 7R allele relative to the younger sample (p = 3.5 × 10(-9)), and that this genotype was strongly correlated with increased levels of physical activity. Consistent with these results, DRD4 knock-out mice, when compared with wild-type and heterozygous mice, displayed a 7-9.7% decrease in lifespan, reduced spontaneous locomotor activity, and no lifespan increase when reared in an enriched environment. These results support the hypothesis that DRD4 gene variants contribute to longevity in humans and in mice, and suggest that this effect is mediated by shaping behavioral responses to the environment.