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.