Having worms in your gut may sound unpleasant, but New Zealand scientists have good reason to believe they could benefit your health.

Photo: Supplied

The research, published in Mucosal Immunology, found that the presence of intestinal parasites provides long-lasting protection against infection from other species of parasites in other organs.

The Malaghan Institute of Medical Research's Dr Kara Filbey, said worms had evolved to manipulate their host's immune system, to prevent it from killing them.

"They need a healthy host to live in, but they also need to survive themselves."

Dr Filbey said the gut worms activated immune cells in the gut which meant the immune system was primed to act quickly if another worm showed up.

"Even if you remove the gut worms entirely, those activated cells remain in the body, waiting to protect against a new infection."

The worms were now being used for research for those with coeliac disease, Dr Filbey said.

"They're widely used in autoimmune and allergic disease research. Therefore, we would have predicted that the immune response against the migrating parasites would have also been suppressed."

But despite this, scientists found that if a person was infected with a gut worm prior to a hookworm infection, which then migrated through the lung, the gut worm protected against the hookworm.

Dr Filbey said it opened the doors for future research, including whether humans were moving towards a future where living with a friendly parasite could protect against infection.

But she said it was not that simple.

"In places where worm infection is endemic alongside a range of other diseases and health conditions, the risks of worm infection probably outweigh any potential benefits. Not all worms are created equal, and there are several species that can cause a range of debilitating diseases in humans."

Dr Filbey said it was a long way off before people would be able to take a pill that gave them the same benefits that friendly parasites did.