BACKGROUND:Compared to the general population, among gay and bisexual men (GBM) prevalence rates of anxiety and depression, and of drug use, are high. OBJECTIVE:This paper explores the relationship between mental health, sexual risk behavior, and drug use among Australian GBM. We identify factors associated with indicators of poor mental health. METHODS:Between September 2014 and July 2017, 3017 GBM responded to measures of anxiety and depression in an online cohort study of drug use. RESULTS:Mean age was 35.3 years (SD 12.8). 17.9% screened positive for current moderate-severe anxiety and 28.3% for moderate-severe depression. The majority (52.2%) reported use of illicit drugs in the previous six months, including 11.2% who had used methamphetamine. One third had high (20.4%) or severe (10.6%) risk levels of alcohol consumption, and 18.3% who were current daily smokers. Most illicit drug use in general was not associated with either anxiety or depression, but men who used cannabis were more likely to show evidence of depression (p = 0.005). Among recent methamphetamine users, 28.0% were assessed as dependent: dependent users were more likely to show evidence of both depression and anxiety than were non-dependent users. High or severe risk drinking was associated with depression and daily tobacco use was associated with both anxiety and depression. Depression and anxiety was associated with: less personal support, viewing oneself as 'feminine', and being less socially engaged with gay men. Sexual risk behavior was not associated with either depression or anxiety. CONCLUSION:Prevalence of anxiety and depression was high, as was prevalence of licit and illicit drug use. Substance use was associated with anxiety and depression only when the use was considered problematic or dependent. Social isolation and marginalization are strong drivers of poor mental health, even within this population for whom anxiety and depression are common.