People with dental cavities have a lower risk of being diagnosed with cancers of the head and neck than people without dental worries, a new study has found.

The findings, researchers say, were quite surprising as poor dental health is linked with many health problems.

Tooth decay happens when lactic acid produced by bacteria corrodes teeth. Some studies have shown that the bacteria associated with tooth decay can protect against certain cancers.

The study doesn't mean that people should stop brushing and let their teeth decay. According to researchers, the study simply shows that a shift of microbial flora in the body can lead to drastic health outcomes.

"The main message is to avoid things that would shift the balance in normal microbial ecology, including overuse of antimicrobial products and smoking. Rather, you should maintain a healthy diet and good oral hygiene, by brushing and flossing," said Dr. Mine Tezal, an assistant professor at the University at Buffalo, State University of New York, HealthDay reported.

The study was based on data of 399 patients with head and neck squamous cell carcinoma and 221 control participants who were diagnosed with any kind of cancer.

Study results showed that people with more cavities had the least risk of developing cancers associated with the neck or head. Even after accounting for other factors such as smoking, sex and marital history, researchers found that people with cavities had about 32 percent lower risk of the cancer, HealthDay reported.

"We could think of dental caries as a form of collateral damage and develop strategies to reduce its risk while preserving the beneficial effects of the lactic acid bacteria," the study concluded.

The study is published in the journal JAMA Otolaryngology-Head & Neck Surgery.