Anal human papillomavirus (HPV) infection commonly affects men who have sex with men (MSM) and is associated with the development of anal cancer, with the highest prevalence in MSM who are positive for human immunodeficiency virus (HIV). The purpose of this study was to determine the prevalence of anal HPV infection and genotype distribution in Slovenian MSM and its correlation with behavioral patterns in order to predict the possible impact of quadrivalent HPV vaccine in this population. To our knowledge, this is the first study of prevalence and genotype distribution of anal HPV infection in MSM from any of the Eastern European countries. The study included 136 MSM who visited two outpatient offices from January 2007 through December 2008. All participants were clinically examined and tested for HIV, and anal swabs were taken for HPV testing. The results showed a high prevalence of anal HPV infection in both HIV-negative (75%) and HIV-positive (95%) MSM. Promiscuity and use of “poppers” (alkyl nitrites taken for recreational purposes through direct inhalation) were clearly associated with a higher prevalence of anal HPV infection. The four most common HPV genotypes were 6, 11, 16, and 18. The prevalence of anal HPV infection in Slovenian MSM is higher in comparison with other studies. Quadrivalent HPV vaccine could have great potential in this population.