Cross-sectional studies suggest an association between bacterial vaginosis (BV) and HIV-1 infection. However, an assessment of a temporal effect was not possible. To determine the association of BV and other disturbances of vaginal flora with HIV seroconversion among pregnant and postnatal women in Malawi, Africa. Longitudinal follow-up of pregnant and postpartum women. Women attending their first antenatal care visit were screened for HIV after counselling and obtaining informed consent. HIV-seronegative women were enrolled and followed during pregnancy and after delivery. These women were again tested for HIV at delivery and at 6-monthly visits postnatally. Clinical examinations and collection of laboratory specimens (for BV and sexually transmitted diseases) were conducted at screening and at the postnatal 6-monthly visits. The diagnosis of BV was based on clinical criteria. Associations of BV and other risk factors with HIV seroconversion, were examined using contingency tables and multiple logistic regression analyses on antenatal data, and Kaplan-Meier proportional hazards analyses on postnatal data. Among 1196 HIV-seronegative women who were followed antenatally for a median of 3.4 months, 27 women seroconverted by time of delivery. Postnatally, 97 seroconversions occurred among 1169 seronegative women who were followed for a median of 2.5 years. Bacterial vaginosis was significantly associated with antenatal HIV seroconversion (adjusted odds ratio = 3.7) and postnatal HIV seroconversion (adjusted rate ratio = 2.3). There was a significant trend of increased risk of HIV seroconversion with increasing severity of vaginal disturbance among both antenatal and postnatal women. The approximate attributable risk of BV alone was 23% for antenatal HIV seroconversions and 14% for postnatal seroconversions. This prospective study suggests that progressively greater disturbances of vaginal flora, increase HIV acquisition during pregnancy and postnatally. The screening and treating of women with BV could restore normal flora and reduce their susceptibility to HIV.