The ecology, behaviour and genetics of our closest living relatives, the nonhuman primates, should help us to understand the evolution of our own lineage. Although a large amount of data has been amassed on primate ecology and behaviour, much less is known about the functional and evolutionary genetic aspects of primate biology, especially in wild primates. As a result, even in well-studied populations in which nongenetic factors that influence adaptively important characteristics have been identified, we have almost no understanding of the underlying genetic basis for such traits. Here, we report on the functional consequences of genetic variation at the malaria-related FY (DARC) gene in a well-studied population of yellow baboons (Papio cynocephalus) living in Amboseli National Park in Kenya. FY codes for a chemokine receptor normally expressed on the erythrocyte surface that is the known entry point for the malarial parasite Plasmodium vivax. We identified variation in the cis-regulatory region of the baboon FY gene that was associated with phenotypic variation in susceptibility to Hepatocystis, a malaria-like pathogen that is common in baboons. Genetic variation in this region also influenced gene expression in vivo in wild individuals, a result we confirmed using in vitro reporter gene assays. The patterns of genetic variation in and around this locus were also suggestive of non-neutral evolution, raising the possibility that the evolution of the FY cis-regulatory region in baboons has exhibited both mechanistic and selective parallels with the homologous region in humans. Together, our results represent the first reported association and functional characterization linking genetic variation and a complex trait in a natural population of nonhuman primates.