Both diet quality and socioeconomic position (SEP) have been linked to age-related cognitive changes, but there is little understanding of how the socioeconomic context of dietary intake may shape its cognitive impact. We examined whether equal adherence to "prudent" and "Western" dietary patterns, identified by principal components analysis, was associated with global cognitive function [Modified Mini-Mental State Examination (3MS)] in independently living older adults with different SEPs (aged 68-84 y; n = 1099). The interaction of dietary pattern adherence with household income, educational attainment, occupational prestige, and a composite indicator of SEP combining all 3 was examined in multiple-adjusted mixed models over 3 y of follow-up in participants of the NuAge study (Quebec Longitudinal Study on Nutrition and Successful Aging). Adherence to the prudent pattern (vegetables, fruits, fish, poultry, and lower-fat dairy products) was related to higher 3MS scores at recruitment only in the upper categories of income [parameter estimate (B): 0.56; 95% CI: 0.11, 1.01], education (B: 0.44; 95% CI: 0.080, 0.80), or composite SEP (B: 0.37; 95% CI: 0.045, 0.70). High prudent pattern adherence was associated with less cognitive decline only in those with low composite SEP (B: 0.25; 95% CI: 0.0094, 0.50). Conversely, adherence to the Western pattern (meats, potatoes, processed foods, and higher-fat dairy products) was associated with more cognitive decline (B: -0.23; 95% CI: -0.43, -0.032) only in those with low educational attainment. In summary, among individuals with equivalent diet quality, the magnitude and characteristics of the diet-cognition relationship depended on their socioeconomic circumstances. These results suggest that interventions promoting retention of cognitive function through improved diet quality would provide maximum benefit to those with relatively low SEP.