Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A large new study confirms that exercise lowers the risk of many different types of cancer, and it goes a step further: It shows just how much the reduction in risk is.

People who exercised the most had a 42 percent lower risk of esophageal cancer and a 27 percent lower risk of liver cancer over 11 years than people who exercised the least, the study of 1.4 million people showed.

Those who exercised the most had:

A 26 percent lower risk of lung cancer

A 23 percent lower risk of kidney cancer

A 22 percent lower risk of stomach cancer

A 21 percent lower risk of endometrial cancer

A 20 percent lower risk of myeloid leukemia

A 17 percent lower risk of myeloma

A 16 percent lower risk of colon cancer

A 15 percent lower risk of head and neck cancer

A 13 percent lower risk of rectal cancer

A 13 percent lower risk of bladder cancer

A 10 percent lower risk of breast cancer

The team at the National Cancer Institute looked at dozens of cancer studies in the U.S. and Europe, and threw all their findings together into a single analysis. They compared the people who exercised more than 90 percent of everyone else in the study to those who exercised the very least.

Mark Holloway of Clemmons, N.C., goes through part of his exercise routine at the Jerry Long YMCA in Clemmons, Tuesday, March 1, 2016. Skip Foreman / AP

The biggest exercisers got in the equivalent of just over an hour a day of brisk walking, said Steven Moore of the National Cancer Institute, who led the study.

They included studies that just looked at strenuous exercise, such as running, and at studies that looked at more moderate exercise, including swimming and strolling and even vigorous yardwork.

On average, the exercisers did two and a half hours of moderate exercise, such as walking, every week. This is about the average for the U.S. as a whole.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: Cancer Deaths Fall, But It's Still a Top Killer

“A higher level of leisure-time physical activity was associated with a 7 percent lower risk of total cancer,” they wrote in their report, published in the Journal of the American Medical Association’s JAMA Internal Medicine.

Exercise has all sorts of benefits, Moore said. "it can help people reduce their risk of heart disease. It can reduce the risk of diabetes. It extends life expectancy. And now it appears that it may reduce the risks of some cancers," Moore told NBC News.

“This finding may help encourage those who are overweight or obese to be physically active."

“Furthermore, our results support that these associations are broadly generalizable to different populations, including people who are overweight or obese, or those with a history of smoking.”

Related: A Third of Cancer Down to Genes

Obesity is a well-known risk factor for cancer, but exercise protected even obese people from cancer, the study found. On average, the people in the study were slightly overweight.

“This finding may help encourage those who are overweight or obese to be physically active,” Moore’s team wrote.

While it's always possible that people who are able to exercise more are healthier in other ways and less likely to develop cancer for some other reason, cancer experts say the evidence is very convincing that exercise directly affects the growth of tumors.

There are three possible ways exercise might lower cancer risk, Moore said. It can lower levels of hormones such as estrogen, which in turn lowers breast and endometrial cancer risk, he said. It helps the body better regulate insulin, and it may lower inflammation.

One odd finding: exercise lowered the risk for lung cancer, but only among current and former smokers.

Exercisers did have a higher risk of melanoma, probably because they often exercised outside. The researchers stress that if you exercise outdoors, you need to use sunscreen.

Related: What Kills Us? Our Own Bad Habits

And men who exercised had a higher rate of prostate cancer. “There is no known biologic rationale to explain this association,” the researchers wrote.

It’s possible, they said, that men who are physically active also are more likely to go to the doctor and get screening tests for prostate cancer, which in turn show up prostate tumors that are slow-growing and not necessarily dangerous to the man.

Doctors should be prescribing exercise to their patients, Moore's team said. Only about half of Americans get the minimum recommended amount of exercise.