One of the groups at highest risk of anal cancer is homosexual and bisexual men. Like cervical cancer, anal cancer is associated with human papillomavirus (HPV) infection. Anal HPV infection was characterized in a study of 346 human immunodeficiency virus (HIV)-positive and 262 HIV-negative homosexual and bisexual men. Anal HPV DNA was detected in 93% of HIV-positive and 61% of HIV-negative men by polymerase chain reaction. The spectrum of HPV types was similar in HIV-positive and HIV-negative men, with HPV-16 the most common type. Infection with multiple HPV types was found in 73% of HIV-positive and 23% of HIV-negative men. Among HIV-positive men who were positive by hybrid capture for group B HPV types (16/18/31/33/35/39/45/51/52/56/58) or group A types (6/11/42/43/44), lower CD4 cell levels were associated with higher levels of group B DNA (P = .004) but not group A DNA. These data suggest increased replication of the more oncogenic HPV types with more advanced immunosuppression.