Even if they were inactive during their younger years, middle aged and older adults who get at least the minimum recommended amount of exercise each week may live longer than their sedentary counterparts, suggests a large UK study.

Physical activity has long been linked to a lower risk of cardiovascular disease and certain cancers. But most research has looked at exercise habits at a single point in time rather than activity patterns across the years, researchers note in The BMJ.

For the current study, researchers assessed activity levels several times over eight years for 14,599 men and women who were between 40 and 80 years old at the outset. After the first eight years, researchers started tracking mortality for another 12.5 years, on average. During that period, there were 3,148 deaths, including 950 from cardiovascular disease and 1,091 from cancer.

The researchers measured both work and leisure-time physical activity in terms of energy expended per kilogram of body weight. Activity increases over time that were equivalent to going from sedentary to meeting the World Health Organization’s recommendation of at least 150 minutes a week of moderate physical activity were associated with a 24% lower risk of death from any cause, a 29% lower risk of cardiovascular death and an 11% lower risk of cancer death compared to those who remained inactive.

“This sends a strong message to all of us, irrespective of what our current life circumstances may be, since it is never too late to build physical activity into your daily routine in order to enjoy a longer healthier life,” said Soren Brage, senior author of the study and a researcher at the University of Cambridge in the UK.

“Everybody benefitted from becoming more active,” Brage said by email. “This was also true for the subgroup of people who already had a serious chronic condition such as heart disease and cancer at baseline.”

The reduced risk of death linked to increasing activity was present regardless of past activity levels and improvements or even worsening of other risk factors such as diet, body weight, medical history, blood pressure and cholesterol levels over the years.

Compared to consistently inactive people, adults who shifted from being inactive to “low” activity levels were 24% less likely to die of any causes during the study, while people who reached “medium” activity levels were 38% less likely to die and adults who achieved “high” activity levels were 42% less likely to die.

At the population level, the researchers calculated, getting at least 150 minutes a week of moderate intensity physical activity would potentially prevent 46% of deaths associated with physical inactivity.

The study wasn’t designed to prove whether or how exercise, or changes in activity over time, might directly prevent disease or help people live longer.

Even so, it adds to evidence suggesting that changing exercise habits late in life can still make a difference, said Dr. I-Min Lee, a researcher at the Harvard T.H. Chan School of Public Health and Brigham and Women’s Hospital in Boston who wasn’t involved in the study.

Other studies that randomly assigned inactive people to start exercising or maintain their current lifestyle have found, among other things, that starting to exercise can improve blood pressure, blood sugar, cholesterol levels, and inflammation and reduce belly fat, Lee said by email.

“Becoming physically active in mid-life can extend longevity,” Lee said.