Objective ·To explore the effects of hypertension and dyslipidemia on cognitive function in the elderly. Methods ·A dynamic population cohort was established by using prospective cohort study methods. In 2019, a complete cohort was selected from residents aged 65 and above who voluntarily participated in a free physical examination program in a community in Shanghai, serving as the baseline cohort. In 2022, 512 community-dwelling elderly aged 67 to 93 were randomly selected from the same community as the follow-up cohort for the study. The collected date included residents′ health records, various physical examination measurements, and Mini-mental State Examination (MMSE) scale scores. Results ·Of the 512 cases that were followed up, the valid sample size was reduced to 495 after data cleaning. According to the baseline and follow-up cognitive assessments and changes, the cases were categorized into three cognitive groups: the improvement group, the normal group, and the decline group. The prevalence of hypertension in the decline group was 43.14% higher than that in the improvement group and 24.39% higher than that in the normal group (66.67% in the decline group vs 23.53% in the improvement group, P=0.011; 66.67% in the decline group vs 42.28% in the normal group, P=0.040). Total cholesterol (TC) in the improvement group was lower than that in the normal group [improvement group (4.38±1.04) mmol/L vs normal group (5.11±1.12) mmol/L, P=0.009]. Additionally, TC in the decline group in 2022 was higher than that in 2019 [paired difference (0.46±0.87) mmol/L, 95% CI 0.08?0.84, P=0.021]. LDL-Ch in the improvement group was lower than that in the normal group [improved group (2.51±0.92) mmol/L vs normal group (3.07±1.00) mmol/L, P=0.024], and their HDL-Ch in 2022 was higher than that in 2019 [paired difference (0.16±0.20) mmol/L, 95% CI 0.06?0.26, P=0.005]. The results of multinomial Logistic regression showed: TC in the improved group was lower than that in the normal group [β=4.12, OR=61.64, 95% CI 1.52?2494.07, P=0.029] and the decline group [β=5.88, OR=357.35, 95% CI 4.54?28149.75, P=0.008]; the TAG [β=1.85, OR=6.34, 95% CI 1.05?38.43, P=0.045], LDL-Ch [β=5.61, OR=274.06, 95% CI 3.65?20567.57, P=0.011], and hypertension [β=1.90, OR=6.69, 95% CI 1.53?29.16, P=0.011] in the decline group were higher than those in the improvement group; the age of the decline group was greater than that of the normal group [β=0.08, OR=1.08, 95% CI 1.00?1.16, P=0.041], and the education level was lower than that of the normal group [β=1.22, OR=3.39, 95% CI 1.28?8.94, P=0.014]. Conclusion ·Low TC and LDL-Ch and high HDL-Ch are beneficial to cognitive improvement. Conversely, hypertension, high TC, high TAG, high LDL-Ch, low education level, and advanced ages are risk factors for cognitive decline.