Our study aimed to investigate the effects of anxiety and obsessive beliefs on sexual function in men with human papillomavirus (HPV) and healthy men. Ninety HPV-positive men (mean age=32.26 ± 6.63 years) from the Urology Outpatient Clinic and 75 healthy men (mean age=33.51 ± 5.67 years) who worked in the hospital were assessed using the International Index of Erectile Function-15 (IIEF-15), Obsessive Beliefs Questionnaire-44 (OBQ), and State-Trait Anxiety Inventory (STAI) in 2023. The mean IIEF-15 scores of the patients with HPV and healthy individuals were 24.59 ± 6.14 vs. 23.16 ± 6.23 for the IIEF-erectile function; 8.30 ± 2.34 vs. 7.79 ± 1.77 for the IIEF-orgasmic function; 7.40 ± 1.73 vs. 7.23 ± 1.53 for the IIEF-sexual desire; 11.30 ± 3.38 vs. 11 ± 3.10 for the IIEF-intercourse satisfaction; and 7.62 ± 2.18 vs. 7.53 ± 2.02 for the IIEF-overall satisfaction (p > 0.05 for all). However, the mean OBQ and STAI scores of patients with HPV and healthy individuals were 46.66 ± 16.06 vs. 36.44 ± 19.25 for the OBQ-inflated responsibility/overestimation of threat (OBQ-RT); 45.91 ± 17.31 vs. 36.53 ± 19.08 for the OBQ-perfectionism/intolerance of uncertainty (OBQ-PU); 28.04 ± 12.31 vs. 23.80 ± 11.74 for the OBQ-importance of thought/control thoughts (OBQ-IC); 37.58 ± 12.06 vs. 33.59 ± 11.09 for the STAI-state anxiety (p < 0.05 for all); and 32.83 ± 8.34 vs. 33.44 ± 11.05 for the STAI-trait anxiety (p = 0.689). Our results showed that the STAI-state anxiety (β = -0.37; β = -0.32; and β = -0.43, respectively) and OBQ-IC (β = -0.57; β = -0.43; and β = -0.48, respectively) scores were the main predictors of the IIEF-erectile function, IIEF-orgasmic function, and IIEF-overall satisfaction scores in the HPV-positive group. The OBQ-RT (β = 0.46), OBQ-PU (β = -0.51) and STAI-state anxiety (β = -0.56) scores were unique predictors of the IIEF-sexual desire score, and the OBQ-RT (β = 0.41), OBQ-PU (β = -0.42), and OBQ-IC (β = -0.43) scores were the main predictors of the IIEF-intercourse satisfaction score in the HPV-positive group. However, regression models for the IIEF-15 subscales for the control group were not significant (p ˃ 0.05). Understanding the role of obsessive beliefs and anxiety in sexual dysfunction among HPV-positive men might be important for developing psychotherapeutic interventions.