BackgroundThis study assesses the impact of adverse childhood experiences (ACEs) on the cognitive function of older adults. Furthermore, it examines the potential underlying mechanism involving education level and the subjective “feeling of loneliness” (FOL).MethodsAnalyzing a population-based cohort sample from the China Health and Retirement Longitudinal Study database, 8,365 subjects aged 45 or older were interviewed in 2018. Ten ACEs indicators were measured using life history questionnaires assessed at 2014. FOL was assessed using a single item from 10-item Center for Epidemiological Studies Depression Scale (CESD-10). Cognitive function was assessed using a structured questionnaire comprising four dimensions: memory, orientation, computation, and visuospatial abilities.ResultsIn the fully adjusted model, which accounted for age, gender, marital status, smoke, drink, rural residence, and education levels of both mothers and fathers, the linear regression analysis indicated that ACEs were inversely associated the lower education level (B = −0.058, 95% CI = −0.090, −0.026, p < 0.001), and ACEs were found to be linked to an elevated risk of FOL (B = 0.072, 95% CI = 0.056, 0.089, p < 0.001). In addition, ACEs was not significantly associated with cognitive function (B = −0.047, 95% CI = −0.108, 0.015, p = 0.136), but FOL was significantly associated with cognitive function (B = −0.483, 95% CI = −0.561, −0.404, p < 0.001). Mediation analysis revealed that education level and FOL sequentially and partially mediated the association between ACEs and the total cognitive score, with a proportion mediated of 52.58%.LimitationsThe evaluation of ACEs exposure was based on binary response options. This method limited our ability to explore various dimensions of adversity, such as ages of occurrence, severity, frequency, duration, and the extent of psychological effects at the time. Furthermore, the assessment of loneliness relied on a single item from the CESD-10, introducing a potential source of measurement error.ConclusionOur study unveils a substantial association between ACEs and education level, as well as with FOL and cognitive function in the older adults. Moreover, education level and FOL serve as sequential mediating factors in the relationship between ACEs and cognitive function.