Heart failure and stroke are on the rise in men below the age of 40, according to a University of Gothenburg study. The scientists found links to obesity and low fitness in the upper teens.

For their study, the researchers analyzed data on 1,258,432 men who, at an average age of 18.3 years, enlisted for military service in Sweden from 1971 to 1995.

The men’s weight, height and physical fitness when they enlisted were merged with data in the National Board of Health and Welfare’s National Patient Register and Cause of Death Register for the period 1991–2016. The men were monitored for more than 20 years.

According to the data, men who were overweight at the time of enlistment, (body mass index of 25–30), increased from 6.6% to 11.2% from 1971 to 1995, while those who were obese (BMI over 30) rose from 1.0% to 2.6%. Their fitness level at the time of enlistment also declined slightly during that same time.

“These factors — that is, overweight, obesity and low fitness — partly explain the large increase in heart failure we see in the study, and the rise in stroke as well,” first author David Åberg, an associate professor at Sahlgrenska Academy, University of Gothenburg, and a specialist doctor at Sahlgrenska University Hospital, said in a press release from the university.

Heart failure and stroke cases both increased during the time frame, according to the study.

Heart failure cases within 21 years of enlistment rose by 69% — from 0.49 per 1,000 men who had enlisted in the first five years (1971–75) to 0.83 per 1,000 who enlisted in the last five (1991–95). The increase for cerebral infarction cases was 32%, from 0.68 for the first five-year cohort to 0.9 per 1,000 for the last. For cerebral hemorrhage, the rise was 20%, from 0.45 to 0.54 per 1,000.

The number of heart attacks and of deaths from cardiovascular disease actually fell during the study’s timeframe. Heart attacks within 21 years of enlistment fell by 43%, from 1.4 to 0.8 per 1,000, of the cohorts enlisting first and last, respectively. Deaths from all cardiovascular disease decreased by 50%, from 1.5 to 0.74 per 1,000.

Although they sound like the same thing, there is a difference between heart attack and heart failure. According to WebMD, most heart attacks happen suddenly when one of the arteries leading to the heart becomes blocked and cuts off the blood flow. Without oxygen, the heart muscles start to die. Heart failure, on the other hand, usually develops gradually.

“It’s pleasing to see, despite rising obesity, a fairly sharp fall in heart attacks among these younger men, and also their reduced mortality from cardiovascular diseases,” he continues.

Researchers said they believe a sharp fall in smoking is why heart attacks decreased, but that weight kept the number from being even lower.

“We see that heart attacks would have decreased even more if it hadn’t been for the rise in overweight and obesity,” Åberg said. “Our results thus provide strong support for thinking that obesity and, to some extent, low fitness by the age of 18 affect early-onset cardiovascular disease. So at societal level, it’s important to try to get more physical activity, and to have already established good eating habits by adolescence, while being less sedentary.”

The study was published Wednesday in the Journal of Internal Medicine.