Treating stroke survivors for a heartbeat problem called atrial fibrillation (AF) might prevent many patients from going on to develop dementia, UK experts believe.
Research into nearly 50,000 patients' records found that AF after a stroke more than doubles the risk of dementia.
Doctors say we should now investigate whether more vigorous treatment with drugs to control AF might delay or even prevent dementia.
The work appears in Neurology journal.
Atrial fibrillation is the most common heart rhythm disturbance and affects up to 500,000 people in the UK.
Although not usually life-threatening in itself, it does increase the risk of stroke.
Blood-thinning drugs and medication to slow the irregular heartbeat are often prescribed to reduce stroke risk.
Now experts at the University of East Anglia in the UK believe tighter management of AF might also offer some protection against dementia.
They looked at research where people with and without AF were followed up to see how many went on to develop dementia.
By analysing 15 separate studies they found that stroke survivors with AF were 2.4 times more likely to develop dementia than stroke survivors who did not have the heart condition.
About a quarter of patients with stroke and atrial fibrillation were found to have developed dementia during follow-up.
Lead researcher Dr Phyo Kyaw said: "These results may help us identify potential treatments that could help delay or even prevent the onset of dementia.
"Options could include more rigorous management of cardiovascular risk factors or of AF, particularly in stroke patients."
Rebecca Wood of Alzheimer's Research UK said: "While this paper shows there is a link between atrial fibrillation and dementia, we don't yet know if treating atrial fibrillation will prevent or delay the onset of dementia.
"More research will give us the answers we urgently need."