Background: Sexually transmitted diseases are a major health problem in all countries. Human papillomavirus (HPV) infection is the most common viral sexually transmitted disease in both genders. High-risk sexual behaviors (HRSBs) are among the major risk factors for HPV infection. Lack of knowledge can contribute to HRSBs and hence, education can potentially reduce HRSB risk. This study evaluated the effects of an educational program based on the Theory of Reasoned Action on HRSBs among patients with HPV. Methods: This two-group randomized controlled trial was conducted in 2017-2018. The educational program was developed based on the results of a survey into the most important components of the Theory of Reasoned Action contributing to HRSBs among 100 patients recruited from Razi hospital, Tehran, Iran. Then, 110 patients from the same hospital were consecutively recruited and randomly allocated to a control (n = 55) and an intervention (n = 55) group and all of them completed a demographic questionnaire and the Sexual Risk Scale. Then, each participant in the intervention group was provided with the developed educational program which consisted of two face-to-face educational sessions in the first and the thirtieth days of the intervention, an educational booklet, and biweekly follow-up telephone contacts. Their counterparts in the control group solely received routine care services. Three months after the first educational session, HRSBs were reassessed in both groups. Results: There were no significant between-group differences respecting participants’ baseline characteristics and mean score of HRSBs (P > 0.05). After the intervention, the mean score of HRSBs significantly decreased in the intervention group (P < 0.001) but did not significantly change in the control group (P = 0.70). The posttest mean score of HRSBs in the intervention group was significantly less than the control group (P = 0.015). Conclusion: Education based on the Theory of Reasoned Action is effective in significantly reducing HRSBs among patients with HPV infection. Nurses can develop and use educational interventions based on this theory to reduce HRSBs and HPV infection. Trial registration: IRCT2016121831453N1 (8 Oct 2017) Keywords: Theory of Reasoned Action, High-risk sexual behaviors, Human papillomavirus