Background: Increased HIV testing frequency among high-risk populations such as men who have sex with men (MSM) and male-to-female transgender women (TW) can lead to earlier treatment and potentially reduce HIV transmission. Methods: We analyzed baseline survey data from 718 high-risk, young (median age 29 [interquartile range 23-35]) MSM/TW enrolled in a community-based HIV prevention trial between 2008-2009. Participants were recruited from 24 neighborhoods in and around Lima, Peru. We assessed HIV testing frequency, testing behaviour, and motivations and barriers to testing. Multivariate analysis identified correlates to prior HIV testing. Results: Overall, 79.6% reported HIV testing within their lifetimes, however, only 6.2% reported an average of two tests per year, as per Peruvian Ministry of Health guidelines. The most commonly reported motivators for testing were to check one's health (23.3%), lack of condom use (19.7%), and availability of free testing (14.0%), while low self-perceived risk for HIV (46.9%), fear of a positive result (42.0%), and lack of access to testing services (35.7%) were the most frequently reported barriers. In multivariate analysis, factors independently associated with HIV testing included age [adjusted prevalence ratio (APR) 1.00, 95% CI (1.00-1.01)], transgender-identification vs. gay-identification [APR 1.11, 95% CI (1.03-1.20)], history of transactional sex [APR 1.16, 95% CI (1.07-1.27)], and prior sexually transmitted infection diagnosis [APR 1.15, 95% CI (1.07-1.24)]. Conclusions: An overwhelming majority of participants did not meet the standard-of-care for testing frequency. The reported motivations and barriers to testing highlight issues of risk perception and accessibility. Our findings suggest utilizing non-traditional outreach methods and promoting HIV testing as a routine part of healthcare in Peru to encourage testing and knowledge of HIV serostatus.