The occurrence of cognitive deficits after subarachnoid hemorrhage (SAH) is highly possible, leading to vascular dementia. We performed a novel longitudinal genome-wide association study (GWAS) to identify genetic modifications associated with cognitive impairment following SAH in a long-term prospective cohort study. This GWAS involved 153 patients with SAH sharing 5,971,372 markers after high-throughput imputation. Genome-wide Cox proportional hazard regression testing was performed to estimate the hazard ratio (HR) and 95% confidence interval (CI). Subsequently, a weighted polygenetic risk score (wPRS) was determined, based on GWAS-driven loci and risk stratification. Cognitive impairment was observed in 65 patients (42.5%) during a mean follow-up of 37.7 ± 12.4 months. Five genome-wide signals, including rs138753053 (PDCD6IP-LOC101928135, HR = 28.33, p = 3.4 × 10-8), rs56823384 (LINC00499, HR = 12.47, p = 2.8 × 10-9), rs145397166 (CASC15, HR = 11.16, p = 1.7 × 10-8), rs10503670 (LPL-SLC18A1, HR = 2.88, p = 4.0 × 10-8), and rs76507772 (IRS2, HR = 5.99, p = 3.5 × 10-8), were significantly associated with cognitive impairment following SAH. In addition, the well-constructed wPRS containing five markers showed nominal ability to predict cognitive impairment (AUROC = 0.745, 95% CI: 0.667-0.824). Tertile stratification showed a higher effectiveness in predicting cognitive impairment, especially in those with haptoglobin 2-1 (HR = 44.59, 95% CI: 8.61-231.08). Our study revealed novel susceptible loci for cognitive impairment, longitudinally measured in patients with SAH. The clinical utility of these loci will be evaluated in further follow-up studies.