Oral infection with human papillomavirus (HPV) is associated with a subset of head and neck cancers. We compared prevalence of, and risk factors for, oral HPV infection among HIV-negative and HIV-infected MSM. Analysis of baseline data from a prospective cohort study. MSM aged 18 years or older were recruited from three study sites in Amsterdam, the Netherlands. Participants completed a self-administered risk-factor questionnaire. Oral-rinse and gargle specimens were analyzed for HPV DNA and genotyped using a highly sensitive PCR and reverse line blot assay [short PCR fragment (SPF)10-PCR-DNA Enzyme Immuno Assay (DEIA)/LiPA25 system]. In 2010-2011, 794 MSM were included, of whom 767 participants had sufficient data for analysis. Median age was 40.1 years [interquartile range (IQR) 34.8-47.5] and 314 men were HIV-infected (40.9%). Any of 25 typable HPV types was present in 24.4% of all oral samples. Oncogenic HPV types were detected in 24.8 and 8.8% of oral samples from HIV-infected and HIV-negative MSM, respectively (P < 0.001). Of these high-risk types, HPV-16 was the most common (overall 3.4%). Oral infection with high-risk HPV was associated with HIV infection in multivariable analysis (P < 0.001). Increasing age was significantly associated with oral HPV infection in HIV-negative, but not in HIV-infected MSM. Oral HPV infection is very common among MSM. HIV infection was independently associated with high-risk oral HPV infection, suggesting an important role of HIV in oral HPV infection.