This study enrolled HIV-infected MSM and HIV-infected women. Participants were randomly assigned to receive the HPV vaccine or a placebo vaccine. At the screening study visit, participants underwent a physical examination, blood collection, anal swab procedure, oral examination, questionnaires, a high-resolution anoscopy (HRA), and if female, a pregnancy test, vaginal swab, and gynecologic exam. At the entry study visit, participants underwent most of the procedures performed at screening (with the exception of an HRA and a gynecologic exam if female) plus a saliva test. Participants received the HPV vaccine or placebo as an injection into their upper arm or thigh on Day 0 and Weeks 8 and 24. Study staff called participants 2 to 3 days after each vaccination for follow-up monitoring. Additional study visits and procedures occurred at Week 28, Week 52, and every 26 weeks thereafter for at least 3 years and for a maximum of 4 years after the last participant was enrolled in the study. Female participants also had a gynecologic exam at screening, Week 52, and every 52 weeks thereafter; a pregnancy test at screening, baseline, Week 8, Week 24, and as indicated; and self-collected vaginal swabs at screening, entry, Week 28, Week 52, and every 26 weeks thereafter. Peripheral blood mononuclear cells (PBMCs) were collected from some participants at entry, Week 28, and study exit.