Messy play should be encouraged, according to the hygiene hypothesis
Children should be allowed to get dirty, according to scientists who have found being too clean can impair the skin's ability to heal.
Normal bacteria living on the skin trigger a pathway that helps prevent inflammation when we get hurt, the US team discovered.
The bugs dampen down overactive immune responses that can cause cuts and grazes to swell, they say.
Their work is published in the online edition of Nature Medicine.
Experts said the findings provided an explanation for the "hygiene hypothesis", which holds that exposure to germs during early childhood primes the body against allergies.
Many believe our obsession with cleanliness is to blame for the recent boom in allergies in developed countries.
Researchers from the School of Medicine at University of California, San Diego, found a common bacterial species, known as Staphylococci, blocked a vital step in a cascade of events that led to inflammation.
By studying mice and human cells, they found the harmless bacteria did this by making a molecule called lipoteichoic acid or LTA, which acted on keratinocytes - the main cell types found in the outer layer of the skin.
The LTA keeps the keratinocytes in check, stopping them from mounting an aggressive inflammatory response.
Head of the research Professor Richard Gallo said: "The exciting implication of the work is that it provides a molecular basis to understand the hygiene hypothesis and has uncovered elements of the wound repair response that were previously unknown.
"This may help us devise new therapeutic approaches for inflammatory skin diseases."
The lobby group Parents Outloud said the work offered scientific support for its campaign to stop children being mollycoddled and over-sanitised.
A spokeswoman for Allergy UK said there was a growing body of evidence that exposure to germs was a good thing.
But she said more research was needed.
"Rates of allergy have tripled in the UK in the last decade. One in three people now has some kind of allergy.
"Some of this might be that people are better informed. But a lot of it is genetic as well as down to our environment," she said.