Background Human papillomavirus (HPV) infection is a sexually transmitted infection that is known as one of the causative factors in cervical cancer among women. This study was conducted to assess the knowledge and attitudes of healthcare providers (HCPs) toward HPV, cervical cancer and HPV vaccine. Methods This cross-sectional study which was carried out from Dec 2022 to Mar 2023, included 440 HCPs working in 3 teaching hospitals in Ahvaz, Southwest Iran. Data were collected using a validated questionnaire to assess HCPs' perception about HPV (20 items) and their attitudes toward HPV vaccine (10 items). A knowledge score (range 0-20) was calculated, and adequate knowledge was assumed for a score >= a cutoff 70% (answering 13 of the 20 items). Factors associated with knowledge were explored and multivariate regression was used to analyze independent factors of adequate knowledge. Results The participants' mean knowledge score of HPV infection and its vaccine was 13.41 out of 20, and 63.4% of the participants had adequate knowledge (score >= 13). Among the participants, 95.7% knew HPV can cause cervical cancer, 76.6% knew HPV vaccine prevents cervical cancers, and 71.6% recommended HPV vaccination to their patients, while a minority declared being immunized (16.6%). There was a statistically significant positive correlation between HPV knowledge and HPV attitude (r = 0.214, p = 0.0001). Bivariate and regression analysis identified that physician profession (OR = 3.85, p = 0.001), female gender (OR = 1.61, p = 0.001) being married (OR = 0.645, p = 0.034), and age higher than 30 years (OR = 0.916, p = 0.003) were significant predictors of adequate knowledge regarding HPV. Conclusion About one-third of the HCPs had poor knowledge towards the HPV infection. Therefore, suggest making some arrangements in effective educational programs regarding HPV for HCPs.