H9 avian influenza virus played a key role during generation of the novel H7N9 virus. A surveillance programme was conducted to assess the H9 virus in relation to the risk of H7N9 virus contamination in the environment. Risk of H7N9 virus contamination in the presence of H9 virus was higher than without (adjusted odds ratio 4·49, 95% confidence interval 3·79–5·31). Adjusted odds ratios of the H7N9 virus associated with co-presence of H9 virus and interacting factors were 4·93 (rural vs. urban area), 46·80 (live poultry markets vs. other premises), 6·86 (Huzhou vs. Hangzhou prefecture), 40·67 (year 2015 vs. 2013), and 9·63 (sewage from cleaning poultry vs. poultry faeces). Regular surveillance on gene variability of H7N9 and H9 viruses should be conducted and extra measures are needed to reduce co-circulation of H7N9 and H9 viruses in the environment.