The sunshine vitamin is made by the skin in response to sunlight helping to top up calcium levels in the body to keep bones, teeth and muscles healthy.
Although the benefits on bone diseases are well known a new study suggests it could also play a protective role on other chronic diseases, including some cancers.
Experts analysed data from 33,736 Japanese men and women aged between 40 to 69. Each gave detailed information on their medical history, diet and lifestyle and blood samples were taken to measure vitamin D levels.
Levels varied depending on the time of year the sample was taken, tending to be higher during the summer and autumn months than in the winter or spring.
After accounting for this seasonal variation, the samples were split into four groups ranging from the lowest to highest levels of vitamin D.
Participants were monitored for an average of 16 years, during which time 3,301 new cases of cancer were recorded.
Adjusting for known cancer risk factors like age, weight, physical activity levels, smoking, alcohol use and diet, researchers found a higher level of vitamin D was associated with a 20 per cent lower relative risk of overall cancer in both men and women.
However, higher vitamin D levels were associated with a 30-50 per cent lower relative risk of liver cancer with the association more evident in men than in women.
No association was found for lung or prostate cancer and there was no increased risk associated with higher vitamin D levels.
Researchers say their findings support the theory that vitamin D may protect against the risk of cancer, but there may be a ceiling effect, suggesting there are no additional benefits beyond a certain level of vitamin D.
Sanjeev Budhathoki, of the National Cancer Center in Tokyo who led the research, said: “We observed that a higher circulating concentration of Vitamin D was associated with a lower risk of subsequent cancer in a large Japanese population.
“Our findings support the hypothesis that vitamin D may confer protection against the risk of cancer.
“Future studies are needed to clarify the optimal concentrations for cancer prevention.”
Sophia Lowes, of Cancer Research UK, said: “Although this study suggests that higher vitamin D levels in the blood could mean lower cancer risk in Asian populations, overall the evidence for a possible link has been mixed.
“It’s not clear whether being deficient in this vitamin just reflects poor general health rather than having a direct impact on cancer risk. Enjoying the sun safely, while taking care not to burn and increase skin cancer risk, should help most people get enough vitamin D in summer.”
Being overweight is the biggest preventable cause of the disease after smoking and is linked to 13 types of cancer, including bowel, breast and pancreatic.
The disease kills 162,000 Britons each year.
The findings are published in the BMJ.