Background Human papillomavirus (HPV) testing for cervical cancer prevention was introduced in Argentina through the Jujuy Demonstration Project (2011-14). The programme tested women aged 30 years and older attending the public health system with clinician-collected HPV tests. HPV self-collection was introduced as a programmatic strategy in 2014. We aimed to evaluate the effectiveness of programmatic HPV testing to detect cervical intraepithelial neoplasia (CIN) of grade 2 or worse (CIN2+) in comparison with cytology-based screening. Methods We did a population-based, before-and-after retrospective cohort study using data from the National Cervical Cancer Prevention Program for the Jujuy province in northwest Argentina. We obtained data for the cytology-based screening period from Jan 1, 2010, until Dec 31, 2011, and for the HPV-based screening period from Jan 1, 2012, until Dec 31, 2014. The primary outcome was detection of histologically diagnosed CIN2+ among women aged 30 years and older. To assess the outcomes in all individuals included in the study, we used multivariable logistic regression and propensity score matching. The reach, effectiveness, adoption, implementation, and maintenance (RE-AIM) framework was used for the before-and-after analysis of programmatic dimensions. Findings Of the 29 631 women who underwent cytology-based screening in 2010-11, CIN2+ was detected in 236 (0•8%) individuals. Of the 49 565 women HPV tested in 2012-14 (clinician-collected tests, n=44 700; self-collection tests, n=4865), 693 (1•4%; 658 clinician-collected tests; 35 self-collection tests) were found to have CIN2+ after the first round of screening. Compared with cytology-based screening, the odds ratio of being diagnosed with a CIN2+ lesion was 2•34 (95% CI 2•01-2•73; p<0•0010) with clinician-collected tests, and 1•08 (0•74-1•52; p=0•68) when screened with self-collection tests, after controlling for age and health insurance status. Screening coverage was similar in both periods (52•7% vs 53•2%); improvements of programmatic indicators were observed in the HPV testing period in relation to laboratory centralisation, lower overscreening (6•6% vs 0•0%), higher adherance to age recommendations (79•3% vs 98•8%), and a decrease of inadequate samples (3•6% vs 0•2%). Interpretation HPV testing in middle-income settings increases detection of CIN2+ lesions and allows for improvement of programmatic indicators. Evidence suggests that the introduction of HPV testing will accelerate the reduction of cervical cancer burden.