Anal cancer is more commonly found in homosexual and bisexual men than cervical cancer is in women. Invasive anal cancer may be preceded by anal squamous intraepithelial lesions (ASIL), and treatment of ASIL may prevent the development of anal cancer. We characterized the prevalence and risk factors for ASIL in 346 HIV-positive and 262 HIV-negative homosexual men. Anal cytology, biopsy of visible anal lesions, and human papillomavirus (HPV) tests were performed, and data on HIV serostatus, CD4 count, and medical and lifestyle history were collected. ASIL was diagnosed in 36% of HIV-positive men and 7% of HIV-negative men (relative risk [RR] = 5.7; 95% confidence interval [CI], 3.6-8.9). Among HIV-positive men, the RR for ASIL increased with lower CD4 levels but was elevated even in men with CD4 levels >500/mm3 (RR = 3.8; 95% CI, 2.1-6.7) when compared with HIV-negative men. High-level HPV infection, as measured by detection of both hybrid capture (HC) group A and group B types, was another significant risk factor for ASIL in both HIV-positive men (RR = 8.8; 95% CI, 2.3-35) and HIV-negative men (RR = 20; 95% CI, 5.5-71) when compared with HC-negative men. HIV-negative men with anal HPV infection and HIV-positive men, regardless of CD4 level, are at high risk for ASIL.