Purpose This study delves into the epidemiology of high-risk human papillomavirus (HR-HPV) infection and its link to precancerous lesions among perimenopausal (40-59 years) and elderly (60-65 years) women in a Chinese county with a notably high incidence of cervical cancer. By uniquely focusing on these age groups in underdeveloped regions, the research aims to offer novel strategies for the management and prevention of cervical cancer. It seeks to inform targeted interventions and public health policies that could significantly benefit women at heightened risk for HPV, addressing a critical gap in current prevention efforts in economically disadvantaged communities. Methods This observational study was conducted at the Maternal and Child Health and Family Planning Service Centre in Lueyang County, from September 2021 to January 2022. It assessed 2008 women aged 40-65 for HPV screening, with 342 undergoing further cytological examination. The study evaluated the prevalence of HPV infection across different age groups and risk categories. It utilized a questionnaire to collect participants' basic information, health behaviors, and other relevant data to analyze factors influencing HR-HPV infection. Statistical analyses comprised chi-square tests, trend analysis, logistic regression, and multiple imputation techniques to address missing data. Results The prevalence of HR-HPV infection among women aged 40-65 years in Lueyang County was 18.43%. Older women exhibited a higher incidence of HPV infection, abnormal ThinPrep Cytology Test (TCT) results (Shaanxi Fu'an Biotechnology Co.Ltd., Baoji City, China), and low/high-grade squamous intraepithelial lesions (LSIL/HSIL) (P<0.05). The most prevalent HR-HPV genotypes in the overall, perimenopausal, and elderly groups were HPV-52, -53, and -58; HPV-52, -53, and -16; and HPV-58, -52, and -53, respectively. The prevalent HR-HPV genotypes in the abnormal The Bethesda System (TBS) results were HPV-16, -52, -33, -58; -16, -52, -58; and-16, -33, and -52. HPV-16, -18, -33 prevalence increased with increasing lesion severity (P<0.05). In this study, factors affecting HR-HPV in the three age groups were found to be mainly related to sexual behavior and education level, including history of lower genital tract diseases, multiple pregnancies, contraceptive methods without tubal ligation, age at first marriage greater than 18 years, never washing the vulva after sex, abstinence from sex, education level of junior high school or above, and spouse's education level of high school or above. Conclusions These findings suggest that the elevated rate of abnormal TBS in the older age group may be attributed to the higher prevalence of persistent infection-prone HR-HPV genotypes (HPV-58, -52, and-53), multiple infections, and potent oncogenic HR-HPV genotypes (HPV-16 and -33). Additionally, the higher HR-HPV prevalence in older patients may be related to lower education attainment, reduced screening rate, and limited condom usage. Therefore, strategies targeting perimenopausal and older women should prioritize enhancing health awareness, increasing screening rates, and encouraging condom utilization.