Background and Objective: Few studies have explored the relationship between malnutrition measured by the Geriatric Nutritional Risk Index (GNRI) and cognitive performance. This study aimed to investigate the association of malnutrition with cognitive function in the Chinese population.Methods: It was a prospective longitudinal study and used three waves of the Chinese Longitudinal Healthy Longevity Survey (CLHLS) data in 2011–2012, 2014, and 2017–2018. Participants aged 60 years or older without mental illness and cerebrovascular diseases were eligible. The GNRI was used to assess nutritional status as follows: normal nutrition (a GNRI > 98), mild malnutrition (92 ≤ a GNRI ≤ 98), and moderate-to-severe malnutrition (a GNRI < 92). Cognitive performance was evaluated by the Mini-Mental State Examination (MMSE) scores. The relationship between the GNRI and cognitive function was analyzed using a linear mixed-effects model.Results: A total of 1,632 subjects were analyzed, including 741 males and 891 females. Of these, 65.0, 19.4, and 15.6% of subjects were at normal nutritional status, mild, and moderate-to-severe malnutrition, respectively. After adjusting for potential confounders, participants under mild and moderate-to-severe malnutrition status have a lower MMSE score [β (95% CI): –0.95 (–1.60, –0.25) and –1.39 (–2.21, –0.57), respectively], compared with those having normal nutrition. Also, there was a linear trend in the association of malnutrition risk with cognitive function in the total population [β (95% CI): –0.74 (–1.13, –0.35)]. However, a significant association of malnutrition with cognitive function was observed only among illiterate females aged above 90 years.Conclusion: This study suggested that there was a significant relationship between the GNRI and cognitive function in the Chinese elderly. Furthermore, subjects with more serious malnutrition have a worse cognitive function, especially in the oldest illiterate females. Clinicians should put more emphasis on assessing the nutritional and cognitive status of the elderly to timely intervene and prevent cognitive impairment.