Heterosexual transmission of the human immunodeficiency virus (HIV) appears to occur readily in Africa but less commonly in North America and Europe. We conducted a case-control study among men attending a clinic for sexually transmitted diseases in Nairobi to determine the prevalence of HIV infection and the risk factors involved. HIV antibody was detected in 11.2 percent of 340 men who enrolled in the study. Reports of nonvaginal heterosexual intercourse and homosexuality were notably rare. Recent injections and blood transfusions were not associated with HIV infection. Travel and frequent contact with prostitutes were associated with HIV seropositivity. Men who were uncircumcised were more likely to have HIV infection (odds ratio, 2.7; P = 0.003), as were those who reported a history of genital ulcers (odds ratio, 7.2; P less than 0.001). A current diagnosis of genital ulcers was also associated with HIV seropositivity (odds ratio, 2.0; P = 0.028). Multivariate analysis revealed an independent association of genital ulcers with HIV infection in both circumcised and uncircumcised men. Uncircumcised men were more frequently infected with HIV, regardless of a history of genital ulcers. Our study finds that genital ulcers and an intact foreskin are associated with HIV infection in men with a sexually transmitted disease. Genital ulcers may increase men's susceptibility to HIV, or they may increase the infectivity of women infected with HIV. The intact foreskin may operate to increase the susceptibility to HIV.