A recent study is the first to sequence a gene known to underlie a complex social phenotype. In the fire ant, Solenopsis invicta, a single allelic difference at the Gp-9 locus specifies the number of queens a colony has, and hence the social structure of the colony. Gp-9 appears to encode a protein implicated in chemical recognition of nestmates, consistent with workers determining queen number by selectively executing queens as a function of workers’ and queens’ Gp-9 genotypes. Other Solenopsis species exhibit the same social and genetic polymorphism. This study pioneers the integrated understanding of the evolution of social behaviour at molecular, individual and social levels.