Heavy smokers with a 40-a-day habit face a much higher risk of two common forms of dementia, a large study shows.
The risk of Alzheimer's is more than doubled in people smoking at least two packs of cigarettes a day in their mid-life.
The risk of vascular dementia, linked to problems in blood vessels supplying the brain, also rose significantly.
The US study, looking at over 21,000 people's records, is published in the journal Archives of Internal Medicine.
The link between smoking and Alzheimer's has already been suggested - but this is one of the biggest studies looking at how smoking in mid-life affects dementia risk decades later.
The long-term research, which used records held by a health insurance firm, found clear evidence of the risk in the heaviest smokers.
No differences in risk were detectable in those smoking less than half a pack a day.
But among those currently smoking two or more packs, equivalent to 40 or more cigarettes a day, there was a 157% increase in the risk of Alzheimer's disease.
There was also a 172% increase in vascular dementia risk compared to someone who had never smoked.
But there was good news for people who had given up by middle-age - their dementia risk 20 years later was no different to those who had never smoked.
Dr Rachel Whitmer, who led the research, said the findings show the brain is not immune to the long-term consequences of heavy smoking.
"We know smoking compromises the vascular system by affecting blood pressure and elevates blood clotting factors, and we know vascular health plays a role in risk of Alzheimer's disease," she said.
Dr Simon Ridley, from the Alzheimer's Research Trust, said it came as no surprise that dementia risk was "entwined" with smoking.
He said: "This study will surely add to an ever growing list of good reasons to quit."
Ruth Sutherland, from the Alzheimer's Society, said that stopping smoking was one element of a healthier lifestyle which could protect against dementia.
She said: "Research has shown that smoking is extremely harmful, and significantly increases the risk of vascular dementia and Alzheimer's, with smokers being twice as likely to develop the disease as non smokers."
In a separate development, 45 organisations have joined forces to work together for better care for people with dementia.
The Dementia Action Alliance will seek to improve training and boost the amount of money spent on dementia research.
Ruth Sutherland said: "There are 750,000 people living with dementia in the UK and this costs the country £20bn a year. It is without doubt the health and social crisis of this generation so this joint approach cannot come soon enough."
One of the members of the alliance is the Department of Health, which joins charities such as Age UK and professional bodies such as the Royal College of GPs.
Care Services Minister Paul Burstow said: "Dementia is more than a health issue, it's one of the defining social challenges of our time. We have to prepare ourselves now for the impact this will have on our society as our population ages."