Background: Food insecurity is a modifiable social determinant that may accelerate cognitive decline in later life. However, longitudinal evidence is complicated by time-varying confounding, and limited research has examined whether Supplemental Nutrition Assistance Program (SNAP) participation modifies domain-specific cogni-tive outcomes. Objectives: To evaluate the longitudinal associations between food in-security and cognitive function using marginal structural models (MSMs), and to as-sess whether SNAP participation buffers these associations for total cognition, episodic memory, and mental status. Methods: Data came from 30,641 adults aged ≥50 in the 1998–2020 Health and Retirement Study, contributing 156,066 person-year observa-tions. Food insecurity and SNAP participation were assessed biennially. Stabilized in-verse probability of treatment weights accounted for time-varying socioeconomic, health, and cognitive confounding. Weighted pooled linear regression MSMs estimated the marginal effects of food insecurity, SNAP, and their interaction. Analyses were stratified by race/ethnicity. Results: In MSMs, both moderate and high food insecurity were associated with lower overall cognition (moderate: b = -0.36; high: b = -0.71; p< 0.001). Similar graded associations were observed for episodic memory (moderate: b = -0.22; high: b = -0.43; p< 0.001) and mental status (moderate: b = -0.15; high: b = -0.28); p< 0.001). SNAP participation significantly attenuated these associations, with positive interaction terms indicating substantial buffering effects. Race-stratified analyses showed consistent patterns across non-Hispanic White, non-Hispanic Black, and His-panic older adults, with particularly strong SNAP buffering among minority groups. Conclusions: The findings suggest that strengthening food assistance access may help reduce cognitive health disparities in aging populations.