Treatment as prevention relies on early uptake of HIV treatment, but onward transmission during primary HIV infection may be affected by changes in sexual risk behavior after diagnosis. What factors are associated with these changes in sexual risk behavior among gay and bisexual men?We surveyed gay and bisexual men recently diagnosed with HIV about changes to their sexual behavior since their diagnosis. In 2008-2010, 263 men described their sexual behavior during the 4 weeks before, and during the 4 weeks after, their HIV diagnosis. In 2010-2015, 301 men reported how they had changed their sexual behavior since their HIV diagnosis.During 2008-2010, 26.6% engaged in condomless anal intercourse with non-HIV-positive casual partners during the 4 weeks before diagnosis, and 9.7% did so during the 4 weeks after diagnosis (P < 0.001). Only peer support from other people with HIV was associated with this change in behavior (OR = 1.42; 95% confidence interval = 1.07 to 1.88; P = 0.014). Peer support was also associated with partner reduction after diagnosis (P = 0.010). During 2010-2015, 31.9% reported that they had increasingly disclosed their HIV status to sex partners since their diagnosis, and 74.1% reported having reduced the number of men with whom they had sex. Peer support was associated with both these changes in behavior (P = 0.003 and P = 0.015, respectively).The risk of onward transmission is likely to be less affected by immediate versus early treatment than it is by earlier diagnosis and peer support for those newly diagnosed with HIV. Enhanced peer support may further reduce the likelihood of onward transmission after diagnosis.