Children have always gravitated toward playing in the dirt. They seem to find a special joy in rolling around and covering themselves in soil whenever possible.

A new study published in the journal Neuroscience proves that kids knew what they were doing all along, because getting dirty can actually be good for your mental health.

Researchers at the University of Bristol and the University College London came upon this discovery unexpectedly. Their curiosity was aroused by a report about human cancer patients being treated with the bacteria Mycobacterium vaccae, which is found in soil. The report said patients noticed the quality of their lives had improved with the treatment.

The researchers reasoned that this effect was the result of the bacteria activating neurons in the brain that contained serotonin.

Serotonin is a monoamine neurotransmitter that is produced in the brain. This neurotransmitter is made from the amino acid tryptophan, which is found in foods like bananas, pineapples, plums, turkey and milk.

When serotonin is released, they change the electrical state of a cell, either exciting the cell or inhibiting it. If the cell is excited, it passes along the chemical message. If it is inhibited, it does not.

When serotonin levels are low, people can feel depressed, which can lead to feelings of anxiety, fear and cause fatigue and insomnia. If serotonin levels are high, like right after eating Thanksgiving dinner, people are more likely to feel relaxed and content.

Starting with this basic understanding of how serotonin affects mood, the researchers began treating mice with the same bacteria that had caused the mood elevation in human cancer patients.

When they examined the brains of the mice they had treated, they found that the bacteria had activated a group of neurons that produce serotonin, resulting in more relaxed mice.

They concluded that the bacteria's effects on the mice may be due to increasing the release of serotonin in parts of the brain that regulate mood.

In a Bristol University press release, Dr. Chris Lowry, the lead author on the paper, noted, "these studies help us understand how the body communicates with the brain and why a healthy immune system is important for maintaining mental health. They also leave us wondering if we shouldn't all be spending more time playing in the dirt."

In fact, future studies are already planned to determine if Mycobacterium vaccae, or perhaps even other bacteria, may have antidepressant properties that can activate this group of serotonin neurons to treat depression in humans.

FoxNews.com managing health editor, Dr. Manuel Alvarez, reviewed this article.