The first human infection with avian influenza A(H7N9) virus was reported in Shanghai, China in March 2013. An additional 32 cases of human H7N9 infection were identified in the following months from March to April 2013 in Shanghai. Here we conducted a case-control study of the patients with H7N9 infection (n = 25) using controls matched by age, sex, and residence to determine risk factors for H7N9 infection. Our findings suggest that chronic disease and frequency of visiting a live poultry market (>10 times, or 1–9 times during the 2 weeks before illness onset) were likely to be significantly associated with H7N9 infection, with the odds ratios being 4·07 [95% confidence interval (CI) 1·32–12·56], 10·61 (95% CI 1·85–60·74), and 3·76 (95% CI 1·31–10·79), respectively. Effective strategies for live poultry market control should be reinforced and ongoing education of the public is warranted to promote behavioural changes that can help to eliminate direct or indirect contact with influenza A(H7N9) virus.