Treating pregnant women for a mild vaginal infection can reduce their risk of miscarriage and premature birth.
Pregnant women were given antibiotics
Bacterial vaginosis occurs when too many of the wrong type of bacteria are present in the vagina. Women often have no symptoms from the infection therefore it can easily be missed.
However, it can be more serious for pregnant women.
UK researchers found treating the condition early on in pregnancy could reduce the risk of both miscarriage and premature birth.
They said it may be advisable to screen women for the condition before they became pregnant, so they could receive treatment.
Researchers from St George's Hospital, London, screened 6,120 pregnant women attending for their first antenatal check between 12 and 22 weeks for bacterial vaginosis or early signs of infection.
Around 480 tested positive and were either given a five-day course of the antibiotic clindamycin or a dummy pill.
They were then monitored to see how many had experienced early miscarriage - up to 24 weeks - and premature delivery - between 24 and 37 weeks.
The optimum time to screen and treat is as yet unknown, and in view of our present knowledge, could well be pre-pregnancy
Dr Austin Ugwumadu, ST George's Hospital
Overall, women who were given clindamycin had 10% fewer miscarriages or premature births than women given the dummy pill.
In the clindamycin group, 13 had a miscarriage or premature delivery compared to 38 in the group which was given the dummy treatment.
Bacterial vaginosis has been linked to early signs of endometriosis, which researchers say could adversely affect the lining of the uterus, and therefore the environment for the developing foetus.
Dr Austin Ugwumadu, who led the research, said: "The number of women with abnormal intermediate flora or bacterial vaginosis needed to treat to prevent one late miscarriage or spontaneous preterm delivery was 10.
"The optimum time to screen and treat is as yet unknown, and in view of our present knowledge, could well be pre-pregnancy.
"The characteristics of the women in our population might differ from those in other parts of the world, and thus our study needs replication in other settings."
Ruth Bender Atik of the Miscarriage Association, said: "The experience of miscarriage or premature birth can be devastating.
"This research not only highlights a possible cause of pregnancy problems but also suggests practical measures to reduce miscarriage and prematurity, and it to be welcomed.
"We look forward to the results of further research, particularly regarding pre-pregnancy or very early pregnancy screening and treatment."
The research is published in the Lancet.