We aimed to examine whether loneliness mediates these associations between perceived neighborhood characteristics and cognition among middle-aged and older adults. Data from wave 10 (2010-2012) to wave 13 (2016-2017) of the Health and Retirement Study were analyzed. Perceived neighborhood characteristics were self-reported. Loneliness was measured by Revised University of California Los Angeles (R-UCLA) Loneliness Scale. Cognition was evaluated by the modified version of Telephone Interview for Cognitive Status. Baron and Kenny's causal steps and multiple linear regression models based on Karlson/Holm/Breen (KHB) method were used to examine the mediating effect. At baseline, 15,142 participants had no cognitive impairment, and 11,413 individuals were finally included in our analysis after 6-year follow-up. Multiple linear regression models suggested that lower perceived neighborhood physical disorder (β=0.073, p=0.033) and greater perceived neighborhood safety (β=0.350, p=0.009) were associated with better cognition. KHB test identified the significant mediating effect of loneliness on the relationships between perceived neighborhood physical disorder (β=0.011, p=0.016) and perceived neighborhood safety (β=0.023, p=0.026) and cognition. Perceived neighborhood characteristics are associated with cognition among middle-aged and older American adults. Loneliness mediated associations between perceived neighborhood physical disorder and perceived neighborhood safety and cognition.