Evidence strongly supports the important role of insulin resistance in cognitive decline and dementia and suggests that insulin sensitizers may protect against cognitive decline in diabetic and pre-diabetic individuals. Inconclusive results have been reported in clinical trials of rosiglitazone, an insulin sensitizer that also increases cardiovascular mortality risks. No study has yet reported a protective cognitive effect of metformin, an insulin-sensitizing biguanide widely used in diabetic patients. We studied 365 older persons aged 55 and over in the population-based Singapore Longitudinal Aging Study with diabetes who were followed up over 4 years. The odds ratios (OR) of association of metformin use (n = 204) versus non-use (n = 161) with cognitive impairment (Mini-Mental State Exam ≤ 23), and by duration: up to 6 years (n = 114) and more than 6 years (n = 90) were evaluated in cross-sectional and longitudinal multivariate analyses. Controlling for age, education, diabetes duration, fasting blood glucose, vascular and non-vascular risk factors, metformin use showed a significant inverse association with cognitive impairment in longitudinal analysis (OR = 0.49, 95% CI 0.25-0.95). Metformin use showed significant linear trends of association across duration of use in cross-sectional and longitudinal analyses (p = 0.018 and p = 0.002, respectively), with use for more than 6 years significantly associated with lowest risk of cognitive impairment in both cross-sectional analysis (OR = 0.30, 95% CI 0.11-0.80) and in longitudinal analysis (OR = 0.27, 95% CI 0.12-0.60). No significant interactive effects of metformin use with APOE-ε4, depression, or fasting glucose level were observed. Among individuals with diabetes, long-term treatment with metformin may reduce the risk of cognitive decline. Further studies should establish the role of hyperglycemia and insulin resistance, and the protective role of metformin in the risk of cognitive decline and dementia.