The risk of dementia in patients with stroke-heart syndrome (SHS) remains unexplored. Retrospective analysis using the TriNetX network, including patients with ischaemic stroke from 2010 to 2020. These patients were categorised into two groups: those with SHS (heart failure, myocardial infarction, ventricular fibrillation, or Takotsubo cardiomyopathy within 30 days post-stroke) and those without SHS. The primary outcome was the 1-year risk of dementia (vascular dementia, dementia in other disease, unspecified dementia, or Alzheimer's disease). The secondary outcome was the 1-year risk of all-cause death. Cox regression analysis after 1:1 propensity score matching (PSM) was performed to calculate the hazard ratios (HRs) and 95% confidence intervals (CIs) for the outcomes. We included 52,971 patients with SHS (66.6 ± 14.6 years, 42.2% females) and 854,232 patients without SHS (64.7 ± 15.4 years, 48.2% females). Following PSM, 52,970 well-balanced patients were considered in each group. Patients with SHS had a higher risk of incident dementia compared to those without SHS (HR 1.28, 95%CI 1.20-1.36). The risk was the highest during the first 31 days of follow-up (HR 1.51, 95%CI 1.31-1.74) and was mainly driven by vascular and mixed forms. The increased risk of dementia in patients with SHS, was independent of oral anticoagulant use, sex and age but it was the highest in those aged <75 years compared to ⩾75 years. SHS is associated with increased risk of dementia. Future studies are needed to develop innovative strategies for preventing complications associated with stroke-heart syndrome and improving the long-term prognosis of these patients.