When a copycat version of the human protein, which is produced by immune cells, was created in the laboratory and injected into mice, it was 100 per cent successful in preventing premature births.
Lead author of the research Professor Kang Chen, from Wayne State University in Michigan, has filed a patent for the treatment, which could be trialled on women within five years.
He said: 'We didn't know much about what these cells did in pregnancy - we didn't even know they existed in the lining of the womb. Now we know they promote healthy pregnancy, which fills an important hole in our knowledge.
"If the trials are successful, we could treat pregnant women with infection, or those at risk of infection, before babies are even put at risk. This is important because premature birth is a leading cause of infant death and also causes long-term illnesses."
The study, published in the journal Nature Medicine, casts new light on how to stop the immune system reacting to infection.
When a pregnant woman develops an infection, her body can start to push out the baby in an attempt to rid her of the bug.
However this is dangerous for tiny babies, which have not yet fully grown in the womb. Researchers found the protein, PIBF1, after taking biopsies of 15 women who gave birth prematurely and 30 who carried their children to full-term.
PIBF1 is itself part of the immune system - however it reacts to stress by acting as a check, potentially preventing a woman going into labour. The mothers who gave birth prematurely had significantly less of this protein.
But when it was injected into nine mice with infections, it stopped all of them going into labour early.
Professor Andrew Shennan, clinical director of Tommy's prematurity clinic at St Thomas' Hospital in London, said: "Preventing pre-term birth remains an enigma and any research that clarifies the mechanism to provide treatment targets is welcomed. This research is important and novel." However he added: "As inflammation can be an important response to infection, more research is needed to ascertain if this is a safe strategy."
While a premature baby is defined as being born before 37 weeks of pregnancy, those who arrive before 32 weeks are classed as very pre-term, and before 28 weeks as extremely pre-term.
Last month BBC host Victoria Fritz gave birth prematurely shortly after presenting the day's business news. Her son William arrived several weeks early after she was suspected of contracting an infection.