Purpose: Cognitive impairment is associated with worsening of diabetic retinopathy (DR). While cognitive impairment has been observed in the elderly with DR, no report on cognition is available in middle‐aged patients with DR. We explored the association between midlife cognitive impairment and DR in an Indian population cohort.Methods: We undertook an institutional analytical cross‐sectional study with middle‐aged type 2 diabetes mellitus patients; there were 36 cases with DR and 36 patients without DR (NODR). Cognition was assessed by mini‐mental state examination (MMSE) questionnaires and compared between both groups.Results: The median age was 55 years in the DR group and 53.5 years in the NODR group. The MMSE score in DR (23.5 ± 3.3, 95% CI 22.3–24.6) was lower (p = 0.015) than in NODR (25.3 ± 3.3, 95% CI 24.2–26.5). The MMSE score in DR was lower in all the domains except for that of language. MMSE score in females (23.1 ± 3.4) was lower (p = 0.001) than in males (25.8 ± 3.0). Education‐adjusted MMSE score was normal among 31 (86.1%) in NODR and 21 (58.3%) in DR (p = 0.009). Dementia was present in 36.1% of cases with DR and 13.9% of cases with NODR. Those with DR had a 4.8 times chance of having education‐adjusted cognitive impairment compared to NODR (p = 0.046, odds ratio 4.8, 95% CI 1.0–22.7). Compared to NODR cases, the chances of having education‐adjusted cognitive impairment increased in mild non‐proliferative DR (p < 0.001, odds ratio 1.8, 95% CI 0.3–11.1), moderate non‐proliferative DR (p = 0.002, odds ratio 4.3, 95% CI 1.1–16.8), and advanced DR (p < 0.001, odds ratio 9.30, 95% CI 1.92–45.10).Conclusions: DR was positively associated with cognitive impairment in middle age in this sample of the Indian population. Copyright © 2022 John Wiley & Sons.