A lack of Vitamin D increases a person's risk of cancer.
Researchers have found that the nutrient - which is created when the body is in sunlight - encourages tumour-fighting bacteria in the gut.
Francis Crick Institute Professor Caetano Reis e Sousa says that the findings mean that people with deficiencies could receive new treatments in the future.
He said: "What we've shown here came as a surprise - Vitamin D can regulate the gut microbiome to favour a type of bacteria which gives mice better immunity to cancer.
"This could one day be important for cancer treatment in humans, but we don't know how and why Vitamin D has this effect via the microbiome.
"More work is needed before we can conclusively say that correcting a Vitamin D deficiency has benefits for cancer prevention or treatment."
Vitamin D is mainly produced by the body when it is exposed to sunlight but it can also be increased by eating foods like eggs, oily fish and red meat.