The discovery, made in mice, supports the idea that over-clean conditions early in life can set the stage for asthma and other allergy diseases.
According to the "hygiene hypothesis", some germ exposure is necessary to prime the developing immune system and keep it under control.
Further work could yield radical bacterial treatments for human infants aimed at preventing asthma, the scientists believe.
Other studies have already shown that airway exposure to bacteria can be "potently effective" at controlling allergy-driven airway inflammation in adult mice.
The team was led by Dr Benjamin Marsland, from the University of Lausanne in Switzerland.