Objectives: To determine the relationship of HIV infection in pregnant women to sexual network size and other risk factors. Design: Case-control study of women attending the public maternity hospital in Lima, Peru. Methods: We interviewed 75 HIV-seropositive women, 41 of their most recent male partners, and two control groups totaling 137 uninfected pregnant women and 70 of their most recent male partners. Each woman's sexual network size was estimated through second and third-generation partnerships over the past year, 5 years and lifetime. Results: Few HIV-seropositive women reported behavioral risk factors for HIV infection, but 79% of male partners were HIV seropositive. Risk factors in male partners included sex with a female sex worker (FSW) or with another man (MSM). The mean 5-year sexual network sizes through the second generation (8.4 persons for HIV-seropositive women, and 2.5 and 1.9 for women in the two control groups) predicted HIV in the women, independently of her own number of partners. These differences were largely attributable to the number of partners reported by male partners. Using data from concurrent studies of FSW and MSM, estimates of 5-year sexual network sizes through the third-generation, excluding contacts with FSW which were protected by consistent condom use, were 672 persons for HIV-seropositive women, and 160 and 224 for women in the two control groups. Conclusions: HIV infection risk among pregnant women in Lima depends largely on their male partners' risk behaviors. Even monogamous women had very large sexual networks.