Heart attack survivors have an increased risk for developing dementia, a new study has found.

Danish researchers studied 314,911 heart attack patients and compared them with 1,573,193 controls who had not had a heart attack. They excluded anyone who had already been diagnosed with dementia or other memory disorders. The study, in Circulation, adjusted for heart failure, pulmonary disease, head trauma, kidney disease and many other variables.

During 35 years of follow-up, there were 3,615 cases of Alzheimer’s disease, 2,034 cases of vascular dementia and 5,627 cases of other dementias among the heart attack patients.

There was no association of heart attack with Alzheimer’s disease. But heart attack increased the risk for vascular dementia, the type caused by impaired blood flow to the brain, by 35 percent.

There are several possible reasons for the link, including similar underlying causes for dementia and heart attack — among them, hypertension, stroke and having undergone coronary artery bypass surgery.