Initial genetic characterizations have suggested that the influenza A (H7N9) viruses responsible for the current outbreak in China are novel reassortants. However, little is known about the pathways of their evolution and, in particular, the generation of diverse viral genotypes. Here we report an in-depth evolutionary analysis of whole-genome sequence data of 45 H7N9 and 42 H9N2 viruses isolated from humans, poultry, and wild birds during recent influenza surveillance efforts in China. Our analysis shows that the H7N9 viruses were generated by at least two steps of sequential reassortments involving distinct H9N2 donor viruses in different hosts. The first reassortment likely occurred in wild birds and the second in domestic birds in east China in early 2012. Our study identifies the pathways for the generation of diverse H7N9 genotypes in China and highlights the importance of monitoring multiple sources for effective surveillance of potential influenza outbreaks.