You might think a worm infection may be bad for your health. Now, though, researchers have found that it actually could be good for your microbiome in your gut. Scientists have found that infection from worms may counter inflammatory bowel diseases (IBD).

In 2012, researchers found that giving worm eggs to monkeys actually protected the mammals from the simian version of IBD. Worm eggs may actually be able to trick the immune system into thinking that it has a worm infection, and triggers a worm-related response that counters gut inflammation.

In this latest study, though, the researchers decided to investigate a bit further. They fed between 10 and 15 parasitic whipworm eggs to mice lacking a gene called NOD2. This particular gene is tied to several immune disorders, including IBD.

After the worms matured, the researchers then measured the amount of Bacteroides and Clostridia in the mice's intestines and stool. They noted the presence or absence of IBD, as well.

So what did they find? It turns out that many of the symptoms of IBD went away along with almost all Bacteroides, while the Clostridia levels increased. The symptoms that disappeared included intestinal bleeding and ulceration.

"Our findings are among the first to link parasites and bacteria to the origin of IBD, supporting the hygiene hypothesis," said P'ng Loke, study co-senior investigator and associate professor at NYU Langone.

The findings could actually change how scientists think about treating IBD. Because worms can act on the gut bacteria thought to cause the disease, this means that researchers may be able to figure out how the worms trigger the reactions so as to help counter IBD.

Currently, the researchers plan to look at how Clostridia outcompete Bacteroides. They also plan to look for harmless Clostridia species that can still induce this effect. They also want to look at alterations to the gut bacteria by worm infections as the foundation of treatments for several inflammatory diseases.

The findings could be huge when it comes to treating IBD. While the presence of worms helping treat IBD may be counterintuitive, it seems that it works.

The findings are published in the April 2016 edition of the journal Science.