If you want to enjoy healthy golden years with fewer chronic illnesses, be sure you’re in good shape by the time you’re 50.

A new study in the Archives of Internal Medicine finds that those who are most fit at midlife suffer the fewest chronic diseases after the age of 65. What’s more, these seniors live healthier lives in their final years before death.

Plenty of studies in recent years have shown that people who are in shape have a lower risk of dying early than those who aren’t physically fit. But there have been questions about whether fitness in the younger years prevents chronic disease later in life, or merely delays it.

This study, led by Dr. Jarrett Berry of the University of Texas Southwestern Medical Center, found that mid-life fitness truly reduced the chance of ever developing eight chronic diseases: heart disease, congestive heart failure, Type 2 diabetes, COPD, kidney disease, Alzheimer's disease and lung or colon cancer.

“We’ve determined that being fit is not just delaying the inevitable, but it is actually lowering the onset of chronic disease in the final years of life,” Berry, an assistant professor of internal medicine, said in a news release.

Berry and his colleagues studied data on more than 18,600 healthy men and women. All the volunteers had done a one-time treadmill test sometime around age 50 to measure their cardiorespiratory fitness.

Using Medicare claims data over the next 26 years, the researchers then linked the treadmill tests to the incidence rate of the eight diseases.

Among those men who scored in the lowest fifth on the fitness test, their rate of developing a chronic disease was 28 per cent per year. But among those in the top fifth, the rate was only 16 per cent per year.

For women, the respective rates were 20 per cent per year versus 11 per cent.

A further analysis found that the positive effects of fitness continued until the end of life: the more-fit men and women tended to live their final five years of life with fewer chronic diseases.

Interestingly, at every age, the highly fit were not necessarily less likely to die than the less fit. The study’s authors said this suggests that fitness leads to “the compression of morbidity in later life."

In other words, the less fit tended to die after long periods of disease; while the highly fit enjoyed good health for most of their senior years and then experienced a short illness before death.

It’s important to note that the study was not able to prove that better midlife fitness led to the lower disease risk; it could only draw a link. It’s possible that the fitter middle-agers also ate healthier foods, which the researchers were not able to take into account.

But they did take into account other factors such as smoking history, obesity and alcohol use, and the link between mid-life fitness and healthy senior years remained.