Target groups for human papillomavirus (HPV) vaccination are controversial. We evaluated vaccine efficacy (VE) against 1-year persistent infection, stratified by age and sexual behavior, among young women in Costa Rica. We randomized 7,466 healthy women 18 to 25 years of age to HPV16/18 or hepatitis A vaccine (follow-up, 50.4 months). According-to-protocol (ATP) cohorts included compliant HPV-negative women; intention-to-treat (ITT) included all randomized women. ATP VE was 90.9% (95% CI, 82.0-95.9) against HPV16/18 infections, 44.5% against HPV31/33/45 (95% CI, 17.5-63.1), and 12.4% (95% CI, -3.2 to 25.6) against any oncogenic infection. Overall ITT VE against HPV16/18 infections was 49.0%, but ATP and ITT VE almost reached 100% in year 4 of follow-up. ATP efficacy against HPV16/18 was similar by age, but ITT VE was greatest among youngest women (68.9% among those 18-19 years of age; 21.8% among those 24-25 years of age) and 79.8% among virgins. Among previously unexposed women, vaccination is highly efficacious against HPV16/18 and partially against HPV31/33/45. Vaccination is most effective in women and girls before they initiate sexual activity, with programmatic and individual decision implications.