BackgroundSerum lipids [total cholesterol (TC), low density lipoprotein cholesterol (LDL-C), high density lipoprotein cholesterol (HDL-C) and triglyceride (TG)] are risk factors for stroke, but the relationships between serum lipids and cognitive impairment have not been verified completely. In this study, we studied the relationships between serum lipids and cognitive impairment and explored whether gender and age had effects on the relationships.MethodsIn this cross-sectional study, we collected serum lipids and cognitive function information from 1762 participants (aged 40–85). Univariate analysis, multivariate analysis, and both gender- and age-based stratified multivariate analysis were used.ResultsIn the entire sample set, there was no significant correlation between serum lipid parameters (TC, LDL-C, HDL-C and TG) and cognitive impairment. In both gender- and age-based stratified multivariate analysis, high serum TC was positively associated with cognitive impairment in the elderly (> 55) male participants (OR = 4.404, 95% CI = 1.264–15.344, p = 0.02), and high serum LDL-C was positively correlated with cognitive impairment in the elderly female subjects (OR = 2.496, 95% CI = 1.057–5.896, p = 0.037), while high serum TG was negatively associated with cognitive impairment in the middle-aged (≤ 55) male participants (OR = 0.157, 95% CI = 0.051–0.484, p = 0.001).ConclusionsThe relationships between serum lipids and cognitive impairment are gender- and age- dependent, with high serum TC and LDL-C may be risk factors of cognitive impairment in the elderly male and female subjects respectively, while high serum TG may be protector of cognitive impairment in the middle-aged male participants.