In recent years, one of the most provocative questions in cancer research has been whether a regular exercise habit can prevent certain cancers from taking hold.

The answer, as with any question related to cancer, is complicated. But a recent study published in The British Journal of Sports Medicine offered a glimpse of how regular physical activity affects the risk of prostate cancer, the second most common and second most fatal cancer in the United States for men (November is prostate cancer awareness month).

In one of the largest such efforts to date, researchers collected data between 1982 and 2019 from 57,652 Swedish men who had participated in at least two fitness tests to see if those who were more active were less likely to develop cancer. Around 1 percent were later diagnosed with prostate cancer. The team found that those who had improved in fitness over the years were 35 percent less likely to have been diagnosed with the disease.

The finding is in line with much of the latest research on the relationship between fitness and cancer diagnosis. According to a 2021 study, for instance, if all adults in the United States were to meet the physical activity guidelines, cancer diagnoses could drop by 3%, or 46,000 cases, every year.

But while there has been extensive research on the relationship between exercise and conditions like breast cancer, there has been less research specifically on prostate cancer. The chance of having prostate cancer rises for all men after 50; risk appears to run in families. About one in eight men will be diagnosed with prostate cancer during their lifetime, according to the American Cancer Society.

Some previous studies looking at the connection between physical activity and prostate cancer have been contradictory, according to Dr. Kate Bolam, a co-author of the study. While some showed increased risk of prostate cancer for those who were physically active, others found a decreased risk.

But many of those studies had small sample sizes or were biased toward healthier people, said Dr. Bolam, a researcher at the Swedish School of Sport and Health Sciences.

“Men who are generally more health-conscious,” she said, “are also good at going to the doctor when they are called for their prostate cancer screening tests.”

More testing means more diagnoses, including in men whose cancers will never progress. Sometimes cancer cells can exist in the prostate for one’s entire life and not be dangerous, so many men who are not tested and do not experience symptoms may never know they have prostate cancer.

The Swedish team was able to create a more nuanced picture by using a national database with hundreds of thousands of in-lab results, including fitness tests measuring how well the heart and the lungs supply oxygen to muscles.

Unlike with studies that rely on patients to report their exercise habits, this gave experts objective measurements. The results clearly showed a link between physical activity and a reduced prostate cancer risk. It also showed that greater improvements in fitness were associated with a greater reduction in risk.

This adds to a growing understanding of how important exercise is for prevention of cancer more generally. In 2019, a review by the American College of Sports Medicine found that regular physical activity significantly reduced the risk of bladder, breast, colon, endometrial, esophageal adenocarcinoma, kidney and stomach cancers. The same analysis also found that having a regular exercise habit was tied to improved treatment outcomes and extended the life expectancies of those already living with cancer.

While it’s not clear exactly how this happens, experts said that one explanation may be that exercise helps fight cancer by enhancing how the immune system targets and eradicates cancer cells.

“We know even a single bout of exercise helps our body release immune cells in our circulation,” said Neil M. Iyengar, a medical oncologist and physician scientist at Memorial Sloan Kettering Cancer Center in New York City who was not involved in the study. “It also helps to improve the population of immune cells in our tissues that fight cancer cells.”

He added: “In somebody who exercises, you see more immune cells that are really able to kill cancer cells. Whereas for someone more sedentary, especially someone who is obese, you see the opposite.”

Researchers do not yet know exactly the right dose and type of exercise that might be most effective, but both the American Cancer Society and the American Society of Clinical Oncology recommend 150 minutes per week, or 20 minutes per day, of aerobic exercise. That could be light walking, jogging or weight-bearing exercises.

Both Dr. Iyengar and Dr. Bolam recommended starting simply: Find an activity that is enjoyable, and get moving. That could be playing with children or grandchildren, going for a walk or joining a recreational sports league. Consistency is key, they said, which is why it’s important to find activity that doesn’t feel like a chore.

“Everyone has a chance to do something that’s really cost efficient here to decrease their risk of prostate cancer,” Dr. Bolam said. “And that’s something that is wholly in our control.”