ObjectiveHIV drug resistance (HIVDR) has become a threat to the elimination of the AIDS epidemic due to the global scale-up of antiretroviral therapy (ART) for HIV-infected individuals. This study aims to investigate the epidemiological dynamics and molecular characterization of HIV pretreatment drug resistance (PDR) and acquired drug resistance (ADR) in Hangzhou, a developed region in China.MethodsAn epidemiological survey combined with a molecular transmission network and Bayesian analysis was conducted. A total of 3,596 individuals with newly confirmed HIV infections (from 2020 to 2023) and 164 individuals with ART failure (from 2021 to 2023) were included. The molecular transmission network was used to identify key drug-resistant transmission clusters, while the Bayesian analysis was utilized to trace the origins and spread of these clusters.ResultsThe overall prevalence of PDR was found to be 8.4% (303/3596). Among these cases, PDR to non-nucleoside reverse transcriptase inhibitors (NNRTIs) accounted for 4.7% (170/3596), significantly higher than the resistance observed for protease inhibitors (PIs; 2.8%, p < 0.001) and nucleoside reverse transcriptase inhibitors (NRTIs; 1.4%, p < 0.001). Multivariate logistic regression analysis revealed a significantly higher PDR value among individuals infected with the CRF07_BC subtype compared to those with the CRF08_BC subtype (aOR = 0.56, 95% CI = 0.359–0.859, p = 0.008). The molecular transmission network analysis identified the transmission of the drug resistance mutation (DRM) Q58E within the clusters of the CRF07_BC subtype. The Bayesian analysis suggested that these clusters were introduced into Hangzhou from Shenzhen between 2005 and 2012. Furthermore, the study highlighted 50.6% (83/164) prevalence of ADR among individuals experiencing ART failure. The combined molecular network analysis of virological failure and newly confirmed HIV infections indicated the transmission of the K103N mutation between these groups.ConclusionIn conclusion, targeted interventions may be necessary for specific subtypes and transmission clusters to control the spread of drug-resistant HIV. Continuous monitoring of resistance patterns is critical to inform treatment strategies and optimize ART regimens.