Introduction: Identifying circulating metabolites that are associated with cognition and dementia may improve our understanding of the pathogenesis of dementia and provide crucial readouts for preventive and therapeutic interventions. Methods: We studied 299 metabolites in relation to cognition (general cognitive ability) in two discovery cohorts (N total = 5658). Metabolites significantly associated with cognition after adjusting for multiple testing were replicated in four independent cohorts (N total = 6652), and the associations with dementia and Alzheimer's disease (N = 25,872) and lifestyle factors (N = 5168) were examined. Results: We discovered and replicated 15 metabolites associated with cognition including subfractions of high-density lipoprotein, docosahexaenoic acid, ornithine, glutamine, and glycoprotein acetyls. These associations were independent of classical risk factors including high-density lipoprotein cholesterol, low-density lipoprotein cholesterol, triglycerides, glucose, and apolipoprotein E (APOE) genotypes. Six of the cognition-associated metabolites were related to the risk of dementia and lifestyle factors. Discussion: Circulating metabolites were consistently associated with cognition, dementia, and lifestyle factors, opening new avenues for prevention of cognitive decline and dementia.