Female mosquitoes are major vectors of human disease and the most dangerous are those that preferentially bite humans. A ‘domestic’ form of the mosquito Aedes aegypti has evolved to specialize in biting humans and is the main worldwide vector of dengue, yellow fever, and chikungunya viruses. The domestic form coexists with an ancestral, ‘forest’ form that prefers to bite non-human animals and is found along the coast of Kenya. We collected the two forms, established laboratory colonies, and document striking divergence in preference for human versus non-human animal odour. We further show that the evolution of preference for human odour in domestic mosquitoes is tightly linked to increases in the expression and ligand-sensitivity of the odorant receptor AaegOr4, which we found recognizes a compound present at high levels in human odour. Our results provide a rare example of a gene contributing to behavioural evolution and provide insight into how disease-vectoring mosquitoes came to specialize on humans. The mosquito Aedes aegypti includes two subspecies, one of which shows a preference for biting humans, whereas the other prefers to bite non-human animals; genetic analysis reveals that changes in the mosquito odorant receptor Or4 contribute to the behavioural difference—in human-preferring mosquitoes, Or4 is more highly expressed and more sensitive to sulcatone, a compound present at high levels in human odour. A 'domestic' form of the mosquito Aedes aegypti, which is the major worldwide vector of dengue, yellow fever and chikungya viruses, has evolved from an ancestral 'forest' form. The former preferentially bites humans, the latter avoids them. Leslie Vosshall and colleagues collected the two forms where they coexist in coastal Kenya, and document striking divergence in preference for human versus animal odour. The human-preferring mosquito carries a version of the olfactory receptor Or4 that is more highly expressed, with greater ligand sensitivity and that makes the mosquito more sensitive to sulcatone, a compound found at high concentration in human odour. This finding provides a rare example of a gene linked to the evolution of behaviour in natural populations.