A case-control study of 913 black cancer patients (aged 15-50 years) was undertaken to measure the association between human immunodeficiency (HIV) infection and cancers believed to have an infective aetiology. Controls were patients with cancers believed not to be infective in origin. The prevalence of HIV in the controls of 7.3% (24 of 325) was similar to the background HIV seropositivity in this population. Odds ratios (ORs) and 95% confidence intervals (CI) adjusted for age, year of diagnosis, marital status and sex were calculated. There was a strong association between HIV infection and Kaposi's sarcoma (KS), with 27 of 33 cases being HIV seropositive, OR = 61.8 (95% CI 19.7-194.2) and an elevated association with non-Hodgkin's lymphoma (NHL), with 27 of 40 cases being HIV seropositive [OR = 4.8 (95% CI 1.5-14.8)]. The elevated odds ratio for KS associated with HIV infection accords with the observed increases in the incidence of KS in several sub-Saharan African countries where the prevalence of HIV is high. The odds ratio for NHL associated with HIV infection was lower than that reported in developed countries, and the reason for this is not clear. No other cancers, including cervical and liver cancers, showed significantly elevated odds ratios associated with HIV infection.