ObjectivesThis study aimed to explore the impact of early neighborhood cohesion, and its mechanism, on cognitive function in later life.MethodsIn total, 10,727 Chinese elderly, aged 60–90, forming two datasets (2014 and 2018) from the China Health and Retirement Longitudinal Study (CHARLS) were used as a sample. Childhood neighborhood cohesion was measured by the extent of how much neighbors were willing to help and how close-knit neighbors were. Mini-Mental State Examination (MMSE) and Center for Epidemiologic Studies Depression Scale (CESD-10) were used to assess the cognitive functions and depression of the elderly. We used a structural equation model to examine the relationship between early neighborhood cohesion and late-life cognitive function and conducted bootstrapping analyses to assess the mechanism.ResultsCognitive function was positively predicted by childhood neighborhood cohesion (β = 0.06, p < 0.001), and cognitive function of the elderly were also positively predicted through the mediating effects of childhood friendships, which included depression and social activity participation as two chain paths.ConclusionThe findings suggest that childhood neighborhood cohesion positively predicts cognitive function among elderly people through the mediating roles of childhood friendship, depression, and social activity engagement. Childhood neighborhood cohesion is correlated with better childhood friendships, then to fewer depression symptoms and greater elderly social activity participation, and finally to better cognitive functions in the elderly.