Evolutionary analyses show that H7 influenza viruses probably transferred from ducks to chickens in China on at least two independent occasions, and that reassortment with H9N2 viruses generated the H7N9 outbreak lineage that recently emerged in humans in China, and a related previously unrecognized H7N7 lineage; these H7N7 viruses are shown to have the ability to infect ferrets, and the current pandemic threat could extend beyond H7N9 viruses. Yi Guan and colleagues examine the evolutionary history of the H7N9 influenza virus recently emerged in humans in China. From field surveillance conducted soon after the emergence of the outbreak, the authors provide a number of new avian influenza genomes: 34 H7N7 genomes, 3 H7N9 genomes and 19 H9N2 genomes, as well as 197 sequences from archived isolates collected in southern China between 2000 and 2013. They find that H7 viruses probably transferred from ducks to chickens on at least two independent occasions and that reassortment with H9N2 viruses generated the H7N9 outbreak lineage — and also another previously unrecognized H7N7 lineage. These H7N7 viruses have the ability to experimentally infect ferrets, and although there is little evidence to suggest these viruses are mammalian adapted, the authors suggest that the current pandemic threat could extend beyond H7N9 viruses. A novel H7N9 influenza A virus first detected in March 2013 has since caused more than 130 human infections in China, resulting in 40 deaths1,2. Preliminary analyses suggest that the virus is a reassortant of H7, N9 and H9N2 avian influenza viruses, and carries some amino acids associated with mammalian receptor binding, raising concerns of a new pandemic1,3,4. However, neither the source populations of the H7N9 outbreak lineage nor the conditions for its genesis are fully known5. Using a combination of active surveillance, screening of virus archives, and evolutionary analyses, here we show that H7 viruses probably transferred from domestic duck to chicken populations in China on at least two independent occasions. We show that the H7 viruses subsequently reassorted with enzootic H9N2 viruses to generate the H7N9 outbreak lineage, and a related previously unrecognized H7N7 lineage. The H7N9 outbreak lineage has spread over a large geographic region and is prevalent in chickens at live poultry markets, which are thought to be the immediate source of human infections. Whether the H7N9 outbreak lineage has, or will, become enzootic in China and neighbouring regions requires further investigation. The discovery here of a related H7N7 influenza virus in chickens that has the ability to infect mammals experimentally, suggests that H7 viruses may pose threats beyond the current outbreak. The continuing prevalence of H7 viruses in poultry could lead to the generation of highly pathogenic variants and further sporadic human infections, with a continued risk of the virus acquiring human-to-human transmissibility.