Smoking damages memory, learning and reasoning according to a UK study of almost 9000 people aged over 50.
Researchers at King's College London investigated the link between heart attacks and strokes and the state of the brain, and found that unhealthy lifestyles can have as big an impact on the brain as the body.
They also found that high blood pressure and being overweight can cause cognitive decline, although the risk is not as strong as smoking.
The researchers collected data about the health and lifestyle of 8800 volunteers, and also tested their mental capabilities by asking them to learn new words or name as many animals as they could in one minute. They were then tested after four years and again after eight years.
The scientists found that the risk of heart attack or stroke was "significantly associated with cognitive decline".
Those who had the highest risk had the most cognitive decline, and there was a "consistent association" between smoking and lower scores on the brain tests.
Related: Is weight gain stopping you from quitting?
"Cognitive decline becomes more common with ageing and for an increasing number of people interferes with daily functioning and well-being," researcher Dr Alex Dregan said.
"We have identified a number of risk factors which could be associated with accelerated cognitive decline, all of which could be modifiable. We need to make people aware of the need to do some lifestyle changes because of the risk of cognitive decline."
The researchers have not been able to confirm how much the cognitive decline affects people's daily lives, or whether the reduction in brain function could cause dementia.
The study was published in the journal Age and Ageing.