Multiple types of human papillomavirus (HPV) are responsible for most cervical cancers but also cause anal cancers-especially in HIV-positive patients. Furthermore, men who have sex with men (MSM) are twice as likely to develop anal cancers as non-MSM. A simple screening test for HPV infection would be useful in these patients. The aim of our study was to evaluate the detection of HPV by real-time polymerase chain reaction (PCR) in urine as a marker of anal infection in MSM. The study included 52 HIV-positive MSM treated at Amiens University Hospital (Amiens, France). After obtaining informed consent, we performed an anal swab and gathered 10 mL of first-void urine. Samples were extracted and amplified in a real-time PCR. Genotypes were determined with a PapilloCheck(®) system (Greiner Bio-One, Frickenhausen, Germany). The anal test was the gold standard for calculating the characteristics of the urine test. The sensitivity of the urine test for diagnosing anal HPV infection was 15%, the specificity was 66%, the positive predictive value was 87.5%, and negative predictive value was 4.5%. The prevalence of anal HPV infection in the study population was 94%. Genotype 42 was the most common. The anal HPV viral load was significantly lower in men in a stable relationship than in single men. However, there was no statistically significant relationship between anal viral load and anal intraepithelial lesions. We conclude that urine-based HPV is a poor predictor of anal HPV infection in HIV-positive MSM.