INTRODUCTION: Use of illicit drugs and oral erectile dysfunction medications (OEM) have been associated with risk behavior among gay men. AIM: To determine the effects of illicit drugs and OEM as risk factors for HIV seroconversion in a community-based cohort of HIV-negative homosexually active men in Sydney, Australia. MAIN OUTCOME MEASURES: Drug use in the previous 6 months and at the most recent sexual encounter; Most recent occasions of unprotected and protected anal intercourse; HIV-positive diagnosis. METHODS: From June 2001 to June 2007, participants were followed up with 6-monthly detailed behavioral interviews and annual testing for HIV. Detailed information about sexual, drug-using and other behavior was collected. RESULTS: Among 1,427 participants enrolled, 53 HIV seroconverters were identified by June 2007. At baseline, 62.7% reported using illicit drugs in the previous 6 months, including 10.7% who reported at least weekly use. Illicit drug use was associated with unprotected anal intercourse with casual partners (P < 0.001). Use of illicit drugs was associated with increased risk of HIV infection at a univariate level, and this risk increased with greater frequency of use. This was also true of the use of OEM. Use of each type of illicit drug was included in multivariate analysis, and after controlling for sexual risk behaviors, only use of OEM remained significantly predictive of HIV infection (Hazard ratios [HR] = 1.75, CI = 1.31-2.33, P < 0.001), although amyl nitrite was of borderline significance (HR = 1.26, CI = 0.98-1.62, P = 0.074). CONCLUSION: The association between drug use and increased risk of HIV infection was strongest for drugs used specifically to enhance sexual pleasure, particularly OEM. The risk of infection was substantially increased when both OEM and methamphetamine were used. Within more "adventurous" gay community subcultures, the interconnectedness of sexual behavior and drug use may be key to understanding HIV risk and is an appropriate priority in HIV-prevention efforts in this population.