Aims We aimed to search for associations between cognitive test results with mortality and rehospitalization in a Swedish prospective heart failure (HF) patient cohort. Methods and results Two hundred and eighty-one patients hospitalized for HF (mean age, 74 years; 32% women) were assessed using cognitive tests: Montreal Cognitive Assessment (MoCA), A Quick Test of Cognitive speed, Trail Making Test A, and Symbol Digit Modalities Test. The mean follow-up time censored at rehospitalization or death was 13 months (interquartile range, 14) and 28 months (interquartile range, 29), respectively. Relations between cognitive test results, mortality, and rehospitalization risk were analysed using multivariable Cox regression model adjusted for age, sex, body mass index, systolic blood pressure, atrial fibrillation, diabetes, smoking, educational level, New York Heart Association class, and prior cardiovascular disease. A total of 80 patients (29%) had signs of cognitive impairment (MoCA score < 23 points). In the fully adjusted Cox regression model using standardized values per 1 SD change of each cognitive test, lower score on MoCA [hazard ratio (HR), 0.75; confidence interval (CI), 0.60-0.95; P = 0.016] and Symbol Digit Modalities Test (HR, 0.66; CI, 0.48-0.90; P = 0.008) yielded significant associations with increased mortality. Rehospitalization risk (n = 173; 62%) was significantly associated with lower MoCA score (HR, 0.84; CI, 0.71-0.99; P = 0.033). Conclusions Two included cognitive tests were associated with mortality in hospitalized HF patients, independently of traditional risk factors. In addition, worse cognitive test scores on MoCA heralded increased risk of rehospitalization.