Cognitive function is a substantially heritable trait related to numerous important life outcomes. Several genome-wide association studies of cognitive function have in recent years led to the identification of thousands of significantly associated loci and genes. Individuals included in these studies have rarely been nonagenarians and centenarians, and since cognitive function is an important component of quality of life for this rapidly expanding demographic group, there is a need to explore genetic factors associated with individual differences in cognitive function at advanced ages. In this study, we pursued this by performing a genome-wide association study of cognitive function in 490 long-lived Danes (age range 90.1−100.8 years). While no genome-wide significant SNPs were identified, suggestively significant SNPs (P < 1 × 10 −5) were mapped to several interesting genes, including ZWINT, CELF2, and DNAH5, and the glutamate receptor genes GRID2 and GRM7. Additionally, results from a gene set over-representation analysis indicated potential roles of gene sets related to G protein-coupled receptor (GPCR) signaling, interaction between L1 and ankyrins, mitogen-activated protein kinase (MAPK) signaling, RNA degradation, and cell cycle. Larger studies are needed to shed further light on the possible importance of these suggestive genes and pathways in cognitive function in nonagenarians and centenarians.