H9N2 influenza viruses have been circulating in China since 1994, but a systematic investigation of H9N2 in Shanghai has not previously been undertaken. Here, using 14 viruses we isolated from poultry and pigs in Shanghai during 2002 and 2006-2014, together with the commercial vaccine A/chicken/Shanghai/F/1998 (Ck/SH/F/98), we analyzed the evolution of H9N2 influenza viruses in Shanghai and showed that all 14 isolates originated from Ck/SH/F/98 antigenically. We evaluated the immune protection efficiency of the vaccine. Our findings demonstrate that H9N2 viruses in Shanghai have undergone extensive reassortment. Various genotypes emerged in 2002, 2006 and 2007, while during 2009-2014 only one genotype was found. Four antigenic groups, A-D, could be identified among the 14 isolates and a variety of antigenically distinct H9N2-virus-derived avian influenza viruses (AIVs) circulated simultaneously in Shanghai during this period. Challenge experiments using vaccinated chickens indicated that the vaccine prevented shedding of antigenic group A and B viruses, but not those of the more recent groups C and D. Genetic analysis showed that compared to the vaccine strain, representative viruses of antigenic groups C and D possess greater numbers of amino acid substitutions in the hemagglutinin (HA) protein than viruses in antigenic groups A and B. Many of these substitutions are located in antigenic sites. Our results indicate that the persistence of H9N2 AIV in China might be due to incomplete vaccine protection and that the avian influenza vaccine should be regularly evaluated and updated to maintain optimal protection.