Persistent anal high-risk human papillomavirus (HR-HPV) infection is a major risk factor for anal cancer among MSM and transgender women (TGW). We aimed to estimate incidence, clearance, and persistence of anal HR-HPV in HIV-positive and HIV-negative MSM and TGW, and to assess factors for HR-HPV persistence. Prospective cohort study. MSM and TGW aged at least 18 years, were enrolled from Indonesia, Malaysia, and Thailand, then followed up 6-monthly for 12 months. Anal swabs were collected at every visit for HR-HPV genotypes to define anal HR-HPV incidence, clearance, and persistence. Logistic regression was used to evaluate factors associated with HR-HPV persistence. Three hundred and twenty-five MSM and TGW were included in this study, of whom 72.3% were HIV-positive. The incidence of anal HR-HPV persistence was higher in HIV-positive than HIV-negative MSM participants (28.4/1000 vs. 13.9/1000 person-months). HIV-positive participants had HR-HPV lower clearance rate than HIV-negative participants (OR 0.3; 95% CI 0.1-0.7). The overall persistence of HR-HPV was 39.9% in HIV-positive and 22.8% HIV-negative participants. HPV-16 was the most persistent HR-HPV in both HIV-positive and HIV-negative participants. HIV infection (aOR 2.87; 95% CI 1.47-5.61), living in Kuala Lumpur (aOR 4.99; 95% CI 2.22-11.19) and Bali (aOR 3.39; 95% CI 1.07-10.75), being employed/freelance (aOR 3.99; 95% CI 1.48-10.77), and not being circumcised (aOR 2.29; 95% CI 1.07-4.88) were independently associated with anal HR-HPV persistence. HIV-positive MSM and TGW had higher risk of persistent anal HR-HPV infection. Prevention program should be made available and prioritized for HIV-positive MSM and TGW where resources are limited.