Objective To characterise vaginal bacterial composition in early pregnancy and investigate its relationship with first and second trimester miscarriages.Design Nested case-control study.Setting Queen Charlotte's and Chelsea Hospital, Imperial College Healthcare NHS Trust, London.Population 161 pregnancies: 64 resulting in first trimester miscarriage, 14 in second trimester miscarriage and 83 term pregnancies.Methods Prospective profiling and comparison of vaginal bacteria composition using 16S rRNA gene-based metataxonomics from 5 weeks' gestation in pregnancies ending in miscarriage or uncomplicated term deliveries matched for age, gestation and body mass index.Main outcome measures Relative vaginal bacteria abundance, diversity and richness. Pregnancy outcomes defined as first or second trimester miscarriage, or uncomplicated term delivery.Results First trimester miscarriage associated with reduced prevalence of Lactobacillus spp.-dominated vaginal microbiota classified using hierarchical clustering analysis (65.6 versus 87.7%; P = 0.005), higher alpha diversity (mean Inverse Simpson Index 2.5 [95% confidence interval 1.8-3.0] versus 1.5 [1.3-1.7], P = 0.003) and higher richness 25.1 (18.5-31.7) versus 16.7 (13.4-20), P = 0.017), compared with viable pregnancies. This was independent of vaginal bleeding and observable before first trimester miscarriage diagnosis (P = 0.015). Incomplete/complete miscarriage associated with higher proportions of Lactobacillus spp.-depleted communities compared with missed miscarriage. Early pregnancy vaginal bacterial stability was similar between miscarriage and term pregnancies.Conclusions These findings associate the bacterial component of vaginal microbiota with first trimester miscarriage and indicate suboptimal community composition is established in early pregnancy. While further studies are required to elucidate the mechanism, vaginal bacterial composition may represent a modifiable risk factor for first trimester miscarriage.Keywords First trimester miscarriage, second trimester miscarriage, vaginal bacteria, vaginal microbiome.Tweetable abstract Vaginal bacterial composition in first trimester miscarriage is associated with reduced Lactobacillus spp. abundance and is independent of vaginal bleeding.