To explore sexually transmitted diseases and sexual behavior as risk factors for cervical cancer, we analyzed data from a population-based case-control study of breast and cervical cancer in Costa Rica. Data from 415 cases of cervical carcinoma in situ, 149 cases of invasive cervical cancer, and 764 controls were included in the analysis. Multivariate analysis showed that lifetime number of sex partners, first intercourse before age 15 years, number of livebirths, herpes simplex virus type 2 seropositivity, and serologic evidence of previous chlamydial infection were predictors of carcinoma in situ. Serologic evidence of previous syphilis was not associated with carcinoma in situ. Predictors for invasive cervical cancer included lifetime number of sex partners, first intercourse before age 15 years, number of livebirths, serologic evidence of previous syphilis, herpes simplex type 2 infection, and chlamydial infection. Cigarette smoking, socioeconomic status, self-reported history of sexually transmitted diseases, and douching were not associated with either carcinoma in situ or invasive cervical cancer.