Background Existing research has found a positive association between cognitive function and residence in a socioeconomically advantaged neighbourhood. Yet, the mechanisms underlying this relationship have not been empirically investigated.Objective To test the hypothesis that neighbourhood socioeconomic structure is related to cognitive function partly through the availability of neighbourhood physical and social resources (eg, recreational facilities, community centres and libraries), which promote cognitively beneficial activities such as exercise and social integration.Methods Using data from a representative survey of community-dwelling adults in the city of Chicago (N=949 adults aged 50 and over), cognitive function was assessed with a modified version of the Telephone Interview for Cognitive Status instrument. Neighbourhood socioeconomic structure was derived from US census indicators. Systematic social observation was used to directly document the presence of neighbourhood resources on the blocks surrounding each respondent's residence.Results Using multilevel linear regression, residence in an affluent neighbourhood had a net positive effect on cognitive function after adjusting for individual risk factors. For white respondents, the effects of neighbourhood affluence operated in part through a greater density of institutional resources (eg, community centres) that promote cognitively beneficial activities such as physical activity. Stable residence in an elderly neighbourhood was associated with higher cognitive function (potentially due to greater opportunities for social interaction with peers), but long term exposure to such neighbourhoods was negatively related to cognition.Conclusions Neighbourhood resources have the potential to promote ‘cognitive reserve’ for adults who are ageing in place in an urban setting.