A new study from the University of Georgia finds a link between a person’s fitness level—specifically, cardiorespiratory fitness—and sleeping ability.

Led by Rodney Dishman, a professor of kinesiology in the College of Education, the study featured in the journal Medicine & Science in Sports & Exercise analyzed data collected over 35 years.

As people age, they risk losing their cardiorespiratory fitness, he says. The longer adults can walk or run on a treadmill as speed and grade increase, the greater their cardiorespiratory fitness is.

“When participants lost a minute on their treadmill time, they experienced a greater risk of sleeping problems,” Dishman says in a release. “Our findings give an incentive for adults to maintain fitness and continue exercising.”

The data, from the Aerobics Center Longitudinal Study, followed a group of over 8,000 men and women from 1971 to 2006. Their cardiorespiratory fitness was measured over four clinic visits, each separated by an average of 2 years.

“This kind of study is novel,” Dishman says. “In the past, studies mostly used self-report as a means of researching physical activity or measured fitness just once. However, this study closely examines the fitness changes in men and women over a long period of time using an objective measure of cardiorespiratory fitness.”

Administered at the Cooper Clinic in Dallas, participants were initially given medical examinations and maximal graded treadmill exercise tests. The men and women, between the ages of 20 and 85, did not complain about sleeping problems during their first visit.

Over time, a significant number of participants lost their cardiorespiratory fitness. By their second or third visits, they were no longer able to exercise like they could during their first visit. Their treadmill endurance decreased during the follow-up exercise tests.

During a check-up with their physicians, participants were asked a series of questions about their health. One of the included questions was whether they had difficulty sleeping and if it was a current problem.

The data showed that for each minute decrease in treadmill endurance between the ages of 51 and 56, sleep complaints increased 1.7% for men and 1.3% for women. Per minute of treadmill decline, the odds were around 8% higher for sleep complaints at the second or third visit.

Depending on an adult’s age, maintaining fitness may be difficult. Around age 45, adults will start losing fitness if they aren’t exercising regularly.

“Fitness is much harder to sustain if you don’t exercise consistently,” Dishman says.

Dishman cites the Federal Physical Activity Guidelines for Americans for those looking to watch their cardiorespiratory fitness.

“It says that adults should get 150 minutes of moderate physical activity or 75 minutes of vigorous activity per week,” he says. “Examples include brisk walking for moderate activity and jogging, biking, and swimming for vigorous activity.”

If adults adhere to the standard guidelines of exercise, they’ll likely maintain cardiorespiratory fitness through middle age.

“Staying active won’t cure sleep complaints, but it will reduce the odds of them,” Dishman says. “The more active you stay, the better off you’ll be.”