But progress in further reducing cardiovascular disease has been hampered by increasing body mass index (BMI) and diabetes prevalence over the same period.
Heart disease and strokes are the two leading causes of death globally.
The number of heart attacks in Scotland fell from 1069 per 100,000 people in 1990 to 276 per 100,000 people in 2014.
Ischaemic strokes, which are caused by a blood clot in the brain, fell from 608 per 100,000 people to 188 per 100,000 people over the same period.
The study found that 74 per cent of this fall in heart attacks and 68 per cent of the reduction in strokes could be accounted for by changes in risk factor prevalence.
However, average BMI increased from 27.2 to 28.1 and the prevalence of diabetes more than doubled, from 4 per cent to 9 per cent of the population.
This was estimated to have led to a 20 per cent rise in heart attacks and a 15 per cent increase in ischaemic strokes attributable to these two risk factors.
The increased diabetes prevalence contributed to nearly as many heart attacks as the number prevented by the decline in smoking, the researchers estimate.
But while the team could be confident that changes in risk factors had an impact on the incidence of heart attacks and strokes, they viewed each risk factor in isolation in their analysis, which means that their estimated impact is likely to be exaggerated.
Researchers say the picture is similar across the UK, with data suggesting that the number of people who are obese and the number of people with diabetes has increased over the past couple of decades.
Analysis also indicates that the contribution made by diabetes to heart and circulatory diseases is increasing.
In 1990, the proportion of deaths from heart and circulatory diseases associated with diabetes was 19 per cent. By 2019, this rose to 26 per cent.
Public health policy should be updated to account for the increasing importance of weight gain and diabetes, says lead author Anoop Shah at the London School of Hygiene & Tropical Medicine.
“There’s a time lag between people contracting diabetes and developing heart and circulatory disease,” says Shah. “We need to act now to address these important risk factors or we risk seeing the impact of these increases for decades to come.”
“Excess weight is a complex issue and we cannot rely on individual willpower and exercise alone to solve the problem of increasing BMI across the population,” says Nilesh Samani, medical director at the British Heart Foundation, which funded the research.
“We need to address the environmental factors that drive weight gain and the development of diabetes to not lose the gains we have made in reducing the burden of cardiovascular diseases,” he says.
Journal reference: The Lancet Regional Health, DOI:
Sign up to our free Health Check newsletter for a round-up of all the health and fitness news you need to know, every Saturday
More on these topics:
Read more at New Scientist