Having too few "friendly" vaginal bacteria may increase a woman's chance of ovarian cancer, and swabs can be used to spot this, say researchers.
The team, led by University College London, hope the finding could be used to identify women at high risk of the cancer, which has no screening test.
However, they say that more work is needed to explore this.
It is too soon to recommend women should be given protective doses of the good bacteria, they say.
The work, which is published in the Lancet Oncology, was funded by money from the government's tampon tax, as well as grants from the EU and the Eve Appeal charity.
About ovarian cancer
More than 7,300 women are diagnosed with ovarian cancer each year in the UK.
Diagnosing it early improves the chances of successful treatment, but the symptoms - bloating and discomfort - can be mistaken for more common, less serious conditions, such as menstrual cramps or irritable bowel syndrome.
Many women are not diagnosed until the cancer has already started to spread.
If your doctor thinks your symptoms could be due to ovarian cancer they will recommend blood tests and scans.
The exact cause of ovarian cancer is unknown, but certain factors increase a woman's risk: age, a family history of ovarian or breast cancer and being overweight.
Now researchers believe micro-organisms living inside our bodies may also play a role.
There is growing scientific evidence that the community of bacteria and other microbes that reside inside us - our microbiome - influence our wellbeing and health.
One species of beneficial bacteria that is thought to be particularly important in the vagina is called lactobacillus.
Experts believe it stops other unhelpful or bad microbes from taking up residence and causing harm.
The study involved 176 women with ovarian cancer, 109 with inherited high-risk genes for ovarian cancer (BRCA1 genes) and 295 women with no known genetic risk.
The women were examined and samples taken using the same collection method used in cervical screening.
Lactobacilli levels were significantly lower in the women under 50 with ovarian cancer or high-risk cancer genes.
What do the findings mean?
It is not clear whether this link is causal or if other factors might explain it, or how much of an impact it has on risk.
Helen Callard, from Cancer Research UK, said: "The microbiome is a really interesting area of research and we're slowly putting pieces together about how our natural bacteria might affect our health. But when interpreting research like this, association doesn't mean causation.
"There are several factors that could influence the risk of ovarian cancer, and different things that can affect the make-up of vaginal bacteria - and it's not always easy to separate these elements. So we need to know how vaginal bacteria might directly affect the risk of developing ovarian cancer. Or whether it's a different factor entirely."
Alexandra Holden, from Target Ovarian Cancer, said: "Before women become concerned about the bacteria in their vagina, more research is required to better understand how the vaginal microbiome may contribute to ovarian cancer, and find better ways to detect the disease. In the meantime, it is crucial for women to be aware of the symptoms, and to visit the GP with any concerns."
The investigators believe good bugs provide a protective barrier to other infections, stopping them from travelling up the gynaecological tract to the fallopian tubes and ovaries.
Researcher Prof Martin Widschwendter said: "We do not yet know for sure whether low levels of the beneficial bacteria leads to an increased risk of ovarian cancer, but that is what we suspect.
"It fits with other research. It's been shown that women who use excessive vaginal hygiene products have lower levels of this bacterium too, and they are at increased risk of ovarian cancer."