This study examined the association of diabetes with the onset of dementia (including Alzheimer's disease (AD), vascular dementia (VD) and any dementia) and mild cognitive impairment (MCI) by using a quantitative meta-analysis of longitudinal studies. EMBASE and MEDLINE were searched for articles published up to December 2010. All studies that examined the relationship between diabetes and the onset of dementia or MCI were included. Pooled relative risks were calculated using fixed and random effects models. Nineteen studies met our inclusion criteria for this meta-analysis, and 6184 subjects with diabetes and 38 530 subjects without diabetes were included respectively. All subjects were without dementia or MCI at baseline. The quantitative meta-analysis showed that subjects with diabetes had higher risk for AD (relative risk (RR):1.46, 95% confidence interval (CI): 1.20–1.77), VD (RR: 2.48, 95% CI: 2.08–2.96), any dementia (RR: 1.51, 95% CI: 1.31–1.74) and MCI (RR: 1.21, 95% CI: 1.02–1.45) than those without. The quantitative meta-analysis showed that diabetes was a risk factor for incident dementia (including AD, VD and any dementia) and MCI.