We found a strong association between HSV-2 seropositivity and HIV infection. Intervention measures against GUD due to HSV-2 infection and syphilis, such as routine testing, early detection, HSV-2 suppressive treatment, and condom distribution, need to be enhanced as part of STI prevention strategies at a national level to effectively reduce HIV infection among MSM in Peru.