Interviews were carried out with 423 women and 93 men with invasive or in situ anal cancer in Denmark and Sweden in a search for clues to the aetiology of this neoplasm. Patients with rectal adenocarcinoma (n = 534) and persons drawn from the background population (n = 554) served as controls. Multivariate logistic regression analyses confirmed previous observations of a strong association between either male homosexual experience or a history of anogenital warts and the risk for anal cancer. Moreover, hitherto unknown, but strong and consistent associations were observed between measures of high heterosexual activity and the risk for anal cancer among both sexes. Polymerase chain reaction analysis revealed human papilloma-virus DNA in the majority (88%) of anal cancer specimens but in none of 20 examined rectal adenocarcinomas. It is concluded that most anal cancers appear to be caused by sexually transmitted types of human papillomaviruses and, consequently, that anal cancer is a potentially preventable neoplasm.