A protein test could tell doctors if a woman is set to go into premature labour, a study has suggested.
Doctors are seeking ways of predicting premature labour
The test, devised by Yale University scientists, can also indicate infections which lead to early birth.
The team said the test of amniotic fluid, detailed to Annual Society for Maternal-Fetal Medicine, was faster and more accurate than existing checks.
A UK expert said the test could be useful, but was only likely to be used in the most serious cases.
This is because doctors can only get a sample of amniotic fluid, which is contained in the sac surrounding the foetus, by inserting a needle - which carries a small risk to the baby.
Doctors currently have to use observational checks such as the regularity of contractions and cervical dilation to assess how far labour has progressed.
But, by the time these signs are apparent, labour is underway and experts say it can be "almost too late" to intervene by giving drugs to stop labour - or sending the woman to a specialist unit.
In the US research, doctors took fresh samples of amniotic fluid from 131 patients with symptoms of premature labour.
All the women had undergone an amniocentesis to determine the maturity of the foetus's lungs.
Standard tests were carried out, such as white blood cell count and glucose levels.
But the team also took a protein "fingerprint" with a proteomic profile test which uses chemically and biologically treated surfaces to attract certain proteins.
Results from the protein test came back from 20 to 30 minutes, twice as fast as conventional lab tests, the researchers found.
Dr Catalin Buhimischi, who led the research, said: "We can now detect infections at a much more incipient stage.
"The presence of two biomarkers for inflammation indicates the median time for delivery is four days.
"If all the biomarkers for inflammation are present, delivery time occurs within hours."
He added: "We now have to take it into the clinic and use the results of this test to provide a rapid treatment to the mother and its baby."
The research has been given an award for the best research in prematurity by the March of Dimes, a US voluntary health agency which seeks to improve babies' health.
Professor James Walker, a spokesman for the Royal College of Obstetricians and Gynaecologists, said doctors were seeking faster and more accurate ways of predicting when women at risk of premature birth will go into labour.
But he said: "The problem with this test is that it uses amniotic fluid - and to get to that, you need to put a needle in.
"So it is only likely to be used in high-risk situations, rather than in routine practice."