To investigate the prevalence of cognitive impairment and its risk factors among Chinese elders aged over 80 years, a community-based, cross-sectional study was conducted from May to June 2016 in Shanghai, China. Cognitive function was measured by using Mini-Mental Status Examination. Multiple logistic regression assessed associations between risk factors and cognitive impairment. Of 480 participants, 30% were diagnosed with cognitive impairment. Women [adjusted odds ratio (AOR): 1.71, 95% confidence interval (CI): 1.03–2.83], solitary life (AOR: 3.15, 1.89–5.26), monthly income less than 2000 Chinese yuan (AOR: 3.47, 1.18–10.23) were significantly associated with increased risk of cognitive impairment, compared with men, non-solitary life, and monthly income greater than 4000 Chinese yuan, respectively. Overweight (AOR: 0.59, 0.36–0.97), being physically active at least 60 minutes per day (AOR: 0.59, 0.35–0.95), antihypertensive drugs users (AOR: 0.45, 0.28–0.72), and lipid lowering drugs users (AOR: 0.21, 0.06–0.76) significantly lowered the risk of cognitive impairment, compared with normal weight, inadequate outdoor activity, and non-medication users, respectively. Accordingly, this study found that women, solitary life, lower income was associated with increased risk of cognitive impairment, while overweight, being physically active, and antihypertensive and lipid lowering drugs usage might lower the risk.