Background Cognitive decline is a debilitating manifestation of disease progression in Parkinson's disease. We aimed to develop a clinical–genetic score to predict global cognitive impairment in patients with the disease. Methods In this longitudinal analysis, we built a prediction algorithm for global cognitive impairment (defined as Mini Mental State Examination [MMSE] ≤25) using data from nine cohorts of patients with Parkinson's disease from North America and Europe assessed between 1986 and 2016. Candidate predictors of cognitive decline were selected through a backward eliminated Cox's proportional hazards analysis using the Akaike's information criterion. These were used to compute the multivariable predictor on the basis of data from six cohorts included in a discovery population. Independent replication was attained in patients from a further three independent longitudinal cohorts. The predictive score was rebuilt and retested in 10 000 training and test sets randomly generated from the entire study population. Findings 3200 patients with Parkinson's disease who were longitudinally assessed with 27 022 study visits between 1986 and 2016 in nine cohorts from North America and Europe were assessed for eligibility. 235 patients with MMSE ≤25 at baseline and 135 whose first study visit occurred more than 12 years from disease onset were excluded. The discovery population comprised 1350 patients (after further exclusion of 334 with missing covariates) from six longitudinal cohorts with 5165 longitudinal visits over 12·8 years (median 2·8, IQR 1·6–4·6). Age at onset, baseline MMSE, years of education, motor exam score, sex, depression, and β-glucocerebrosidase (GBA) mutation status were included in the prediction model. The replication population comprised 1132 patients (further excluding 14 patients with missing covariates) from three longitudinal cohorts with 19 127 follow-up visits over 8·6 years (median 6·5, IQR 4·1–7·2). The cognitive risk score predicted cognitive impairment within 10 years of disease onset with an area under the curve (AUC) of more than 0·85 in both the discovery (95% CI 0·82–0·90) and replication (95% CI 0·78–0·91) populations. Patients scoring in the highest quartile for cognitive risk score had an increased hazard for global cognitive impairment compared with those in the lowest quartile (hazard ratio 18·4 [95% CI 9·4–36·1]). Dementia or disabling cognitive impairment was predicted with an AUC of 0·88 (95% CI 0·79–0·94) and a negative predictive value of 0·92 (95% 0·88–0·95) at the predefined cutoff of 0·196. Performance was stable in 10 000 randomly resampled subsets. Interpretation Our predictive algorithm provides a potential test for future cognitive health or impairment in patients with Parkinson's disease. This model could improve trials of cognitive interventions and inform on prognosis. Funding National Institutes of Health, US Department of Defense.