Vaccination against high-risk human papillomaviruses (HPV) is currently the main mechanism for reducing cervical cancer in Spain. The objective of this study is to investigate the prevalence and distribution of HPV types within a population of 30,947 subjects with suspicion of HPV infection and/or with a genital lesion diagnostic from 2007 to 2022. Samples were analysed by polymerase chain reaction (PCR), restriction fragment length polymorphism (RFLP) analysis and/or DNA sequencing. An overall HPV prevalence of 29.2% and 49 different types were verified, of which HPV 16, 53, 31, 66, 6, 58, 61, 33, 18 and 84 were the most common. HPV 6, 16, 31 and 33 were more prevalent in younger populations, while HPV 18, 53, 58, 61, 70 and 83 presented higher frequencies in older ages. High-risk HPVs had a frequency of 47.3% in positive samples, which was higher in atypical squamous or glandular cells (73.7%), low-degree squamous intraepithelial lesions (67.0%) and high-degree squamous intraepithelial lesions (87.1%). A reduction tendency of high-risk HPVs was observed during the studied period, indicating the effectiveness of the vaccination program. By determining the HPV distribution in Spain, this study presents baseline information that can be applied for assessing prophylactic and therapeutic strategies.