Until now, the only cancers that have been strongly associated with AIDS are Kaposi's sarcoma and non-Hodgkin lymphoma. We used a linkage between AIDS (50,050 reports) and cancer (859,398 reports) registries in seven health departments in the USA to investigate the association between HIV infection and epidermoid anal cancer. We compared the numbers of observed cases and expected cases, calculated from general population rates with adjustment for age, sex, and race. The relative risk of anal cancer at and after AIDS diagnosis was 84.1 (95% CI 46.4-152) among homosexual patients (11 cases) and 37.7 (9.4-151) among non-homosexual patients (2 cases). The relative risk of anal cancer up to 5 years before the AIDS diagnosis (23 cases) was also increased; it was 13.9 (6.6-29.2) in the period 2-5 years before AIDS and 27.4 (15.9-47.2) during the 2 years before AIDS diagnosis (p for trend = 0.004). Among homosexual men, the relative risk of anal cancer was inversely related to age at AIDS onset (p for trend < 0.001). Excess risks were found in all geographical areas. This study establishes a strikingly increased risk of anal cancer among people with AIDS. These data are consistent with a previously hypothesized association between HIV-induced immunodeficiency and anal cancer development, but because homosexual men were at increased risk of anal cancer even before the AIDS epidemic, we cannot say how much of the increased risk is attributable to HIV infection. Nevertheless, clinicians should be aware that AIDS patients have an increased risk of anal cancer.