Modifiable risks for dementia are more prevalent in rural populations, yet there is a dearth of research examining life course rural residence on late-life cognitive decline. The association of rural residence and socioeconomic status (SES) in childhood and adulthood with late-life cognitive domains (verbal episodic memory, executive function, and semantic memory) and cognitive decline in the Kaiser Healthy Aging and Diverse Life Experiences cohort was estimated using marginal structural models with stabilized inverse probability weights. After adjusting for time-varying SES, the estimated marginal effect of rural residence in childhood was harmful for both executive function (β = -0.19, 95% confidence interval [CI] = -0.32, -0.06) and verbal episodic memory (β = -0.22, 95% CI = -0.35, -0.08). Effects of adult rural residence were imprecisely estimated with beneficial point estimates for both executive function (β = 0.19; 95% CI = -0.07, 0.44) and verbal episodic memory (β = 0.24, 95% CI = -0.07, 0.55). Childhood rurality is associated with poorer late-life cognition independent of SES.