Background: Prostate cancer is one of the most frequent cancers in men, with several risk factors, including infection. In this study, we aimed to assess the association of human papillomavirus (HPV) infection with prostate cancer risk and aggressiveness. Methods: This case-control study was performed on a total of 70 archival formalin-fixed paraffin-embedded (FFPE) prostatic tissue blocks. Among them, 35 histopathologically confirmed prostate cancer tissues and 35 benign prostate hyperplasia (BPH) samples were enrolled as cases and controls, respectively. The specimens were examined by the polymerase chain reaction (PCR) and in situ hybridization for the detection of HPV DNA of both low-risk (6, 11) and high-risk (16, 18) types. Results: The primary results of PCR for the L1 region revealed HPV infection in 34.3% and 8.6% of the cases and controls, respectively (P = 0.018). The HPV typing using hybridization revealed a significant difference between the two groups in terms of infection with HPV types 16 and 18 (P = 0.003, P = 0.028, respectively). The findings showed no significant association of HPV infection with age and prostate specific antigen (PSA) level of the patients. In addition, no significant association was found between infection with HPV and Gleason score (GS). Conclusions: Our findings indicated that HPV infection, especially with high-risk types 16 and 18, has a significant association with prostatic carcinogenesis. In addition, although patients with GS = 7 showed higher rates of infection with HPV, we did not observe any statistical association between HPV infection and GS.