Understanding what social factors are associated with risk of HIV acquisition and transmission among gay, bisexual and other men who have sex with men (MSM) is a critical public health goal. Experiencing discrimination may increase risk of HIV infection among MSM. This analysis assessed relations between experiences of sexual orientation- and race-based discrimination and sexual HIV risk behavior among MSM in New York City. 1,369 MSM completed a self-administered computerized assessment of past 3-month sexual behavior, experience of social discrimination and other covariates. Regression models assessed relations between recent experience of discrimination and sexual HIV risk behavior. Mean age was 32 years; 32 % were white; 32 % Latino/Hispanic; 25 % African American/Black. Of MSM who self-reported HIV-positive or unknown status (377), 7 % (N = 27) reported having unprotected insertive anal intercourse with an HIV-negative or unknown status partner ("HIV transmission risk"). Of MSM who self-reported HIV-negative status (992), 11 % (110) reported unprotected receptive anal intercourse with an HIV-positive or unknown status partner ("HIV acquisition risk"). HIV acquisition risk was positively associated with sexual orientation-based discrimination in home or social neighborhoods, but not race-based discrimination. We observed that sexual orientation-based discrimination was associated with sexual HIV risk behavior among urban-dwelling MSM. Addressing environmental sources of this form of discrimination, as well as the psychological distress that may result, should be prioritized in HIV prevention efforts.