OBJECTIVE:To examine the trends of HIV prevalence, risk behaviours and HIV testing among men who have sex with men (MSM) in Nanjing. DESIGN:Five consecutive cross-sectional surveys. SETTING:Nanjing, China. PRIMARY AND SECONDARY OUTCOME MEASURES:HIV and syphilis prevalence, HIV testing rate and factors associated with HIV infection; demographic characteristics and behaviours. RESULTS:649, 669, 577, 633, 503 MSM were recruited from 2013 to 2017. HIV prevalence was 9.9%, 12.3%, 12.5%, 9.8% and 10.1%, respectively. Syphilis prevalence decreased with a range from 10.6% to 5.6%. Risk behaviours like unprotected anal intercourse (UAI) and unprotected virginal sex in the past 6 months decreased, but multiple sex partners and ever used rush popper rose significantly. MSM tested for HIV in the previous year remained stable from 57.0% to 64.1% (P=0.633). Multivariate analysis showed that tested for HIV in the past year was protective factor against HIV infection. MSM who had UAI in the past 6 months, sex role as receptive and dual, diagnosed with sexually transmitted diseases (STDs) in the past year and currently syphilis infected were risk factors for HIV infection. CONCLUSIONS:We observed stable high HIV prevalence, a steady HIV testing rate, decreasing syphilis prevalence and UAI among MSM in Nanjing. However, rush popper use rose dramatically. The HIV preventive strategies for MSM including condom promotion, HIV testing expansion and reduction of rush popper use, STDs screening and standardised treatment should be strengthened.