We examined factors associated with the subsequent development of AIDS-related Kaposi's sarcoma in a cohort of 353 homosexual men infected with human immunodeficiency virus (HIV). Cumulative incidence curves for the development of Kaposi's sarcoma and opportunistic infection were stratified over a wide range of variables at enrollment, including those related to demographics, sexual behavior, illicit drug use, and medical history. We found no strong associations between any of these variables and the development of opportunistic infection, but two were related to Kaposi's sarcoma: use of nitrite inhalants (relative risk, 2.3; 95% confidence interval, 1.0-5.0) and high numbers of sexual contacts during the period 1978-1982 in the AIDS epidemic centers of San Francisco, Los Angeles, and/or New York (relative risk, 3.5; 95% confidence interval, 1.6-7.6). The latter variables remained independently associated with risk of Kaposi's sarcoma even after multivariate adjustment for a number of classical HIV risk factors. These results are consistent with the hypothesis that Kaposi's sarcoma is caused by a sexually transmitted cofactor that has remained more prevalent in the original epidemic centers. The effect of nitrites could be due to an independent biological mechanism or to enhancement of transmission of the cofactor.