MONDAY, April 9, 2018 (HealthDay News) -- Staying physically fit can help ward off heart trouble, even if your genetics put you at higher risk for clogged arteries, a new, large study suggests.

The researchers looked at nearly 500,000 middle-aged and older adults and found those with higher fitness levels were less likely to develop heart disease over six years. And that was true even for people who carried gene variants that raise the odds of heart problems.

That does not mean exercise erases the effects of genes, the researchers added. But if you do have a genetic vulnerability to heart disease, you're better off being physically fit.

"It's likely that if you try to improve your fitness level through exercise, you'll benefit," said senior researcher Dr. Erik Ingelsson, a professor of medicine at Stanford University in California.

How much, or what type, of exercise is "enough"? The study cannot answer those questions, Ingelsson said.

His team did not test any particular exercise regimens. The researchers looked at how people's fitness levels -- gauged during a stationary bike workout -- correlated with their risk of developing heart disease over the next six years.

They found that regardless of the genes people carried, higher fitness levels meant a lower risk of heart trouble.

Among the one-third of people at highest genetic risk, those with the highest fitness levels were 49 percent less likely to develop coronary heart disease, compared to those who were the least fit. And they were 60 percent less likely to develop atrial fibrillation.

Coronary heart disease refers to hardened, narrowed heart arteries that can lead to a heart attack or other complications. Atrial fibrillation is a common heart rhythm disorder that raises the risk of stroke and heart failure.

"This is a great study," said Dr. Suzanne Steinbaum, a cardiologist and spokesperson for the American Heart Association who wasn't involved with the study. "Exercise really is the best medicine."

The study has limitations, she pointed out: It did not directly test the effects of exercise. It was an observational study that followed people's outcomes, so it does not prove cause and effect.