Objective To investigate the epidemiological status of cognitive impairment in elderly patients with hypertension in Shanghai community, and analyze the influencing factors. Methods A total of 1 192 elderly people over 65 years old were selected from 6 community neighborhood committees of Huajing Town, Xuhui District, Shanghai by random cluster sampling. The prevalence of cognitive impairment in the elderly was assessed by 8-item Ascertain Dementia (AD-8) screening questionnaire. The prevalence of hypertension in the elderly was obtained by face-to-face interview. The correlation between different lifestyles and cognitive impairment in elderly patients with hypertension was analyzed by multivariate regression analysis. Results A total of 565 patients with hypertension and 185 patients with cognitive impairment were detected. Among the 565 elderly patients with hypertension, 103 had cognitive impairment. The prevalence of cognitive impairment in elderly patients with hypertension was 18.2%, which was significantly higher than that in nonhypertensive patients [13.1%(82/527), χ2 =6.016, P=0.014]. The protective factors of cognitive impairment in elderly patients with hypertension were enjoying exercise (OR=0.56, 95%CI=0.34-0.93, P=0.025) and often participating in community activities for the elderly (OR=0.48, 95%CI=0.24-0.93, P=0.045). Less than 7 hours of sleep per day (OR=2.13, 95%CI=1.30-3.48, P=0.003) was a risk factor for cognitive impairment in elderly patients with hypertension. Conclusions Regular exercise, participating in community activities and sleep time deficiency were the influential factors of cognitive impairment in elderly patients with hypertension.Promoting healthy lifestyle in the elderly patients with hypertension is an important measure to prevent development of cognitive impairment.