Chlamydia trachomatis, Neisseria gonorrhoeae, Trichomonas vaginalis, and bacterial vaginosis have been associated with adverse maternal and perinatal outcomes, but there is conflicting evidence on the benefits of antenatal screening and treatment for these conditions. We aimed to determine the effect of antenatal point-of-care testing and immediate treatment of C trachomatis, N gonorrhoeae, T vaginalis, and bacterial vaginosis on preterm birth, low birthweight, and other adverse maternal and perinatal outcomes compared with current standard of care, which included symptom-based treatment without laboratory confirmation. In this pragmatic cluster randomised crossover trial, we enrolled women (aged ≥16 years) attending an antenatal clinic at 26 weeks' gestation or earlier (confirmed by obstetric ultrasound), living within approximately 1 h drive of a study clinic, and able to provide reliable contact details at ten primary health facilities and their catchment communities (clusters) in Papua New Guinea. Clusters were randomly allocated 1:1 to receive either the intervention or control (standard care) in the first phase of the trial. Following an interval (washout period) of 2-3 months at the end of the first phase, each cluster crossed over to the other group. Randomisation was stratified by province. Individual participants were informed about trial group allocation only after completing informed consent procedures. The primary outcome was a composite of preterm birth (livebirth before 37 weeks' gestation), low birthweight (<2500 g), or both, analysed according to the intention-to-treat population. This study is registered with ISRCTN Registry, ISRCTN37134032, and is completed. Between July 26, 2017, and Aug 30, 2021, 4526 women were enrolled (2210 [63·3%] of 3492 women in the intervention group and 2316 [62·8%] of 3687 in the control group). Primary outcome data were available for 4297 (94·9%) newborn babies of 4526 women. The proportion of preterm birth, low birthweight, or both, in the intervention group, expressed as the mean of crude proportions across clusters, was 18·8% (SD 4·7%) compared with 17·8% in the control group (risk ratio [RR] 1·06, 95% CI 0·78-1·42; p=0·67). There were 1052 serious adverse events reported (566 in the intervention group and 486 in the control group) among 929 trial participants, and no differences by trial group. Point-of-care testing and treatment of C trachomatis, N gonorrhoeae, T vaginalis, and bacterial vaginosis did not reduce preterm birth or low birthweight compared with standard care. Within the subgroup of women with N gonorrhoeae, there was a substantial reduction in the primary outcome. UK Department of Health and Social Care; UK Foreign, Commonwealth and Development Office; UK Medical Research Council; the Wellcome Trust; the Australian National Health and Medical Research Council; and Swiss National Science Foundation.