Objective: To understand the incidence of HIV infection, high risk behaviors and pre-exposure prophylaxis/post-exposure prophylaxis (PrEP/PEP) utilization in men who have sex with men (MSM) in Beijing. Methods: Sample size was estimated to be 1 227 persons and 207 person year respectively in the survey and the cohort by using Epi Info 7.0 software. Using convenient sampling method, MSM were recruited by using Wechat app. Questionnaire was completed online to collect the information about demographic characteristics, high risk behavior, and utilization of PrEP/PEP of the MSM. MSM collected dry blood spot (DBS) samples by themselves, and mailed the DBS samples to laboratory for HIV nucleic acid testing. Open cohort was established and those with HIV negative nucleic acid testing results were followed up. Non-conditional binary logistic regression method was used to identify the associated factors for high risk anal sex in the last month and having multiple homosexual partners in the last month. Results: A total of 1 147 MSM were recruited, and follow up for 236 person years was conducted in 956 MSM with negative HIV nucleic acid testing results. The detection rate of new HIV infection was 1.3 per 100 person-years (3/236). During the last month, the proportions of consistent condom use in anal sex and oral sex were 50.7% (238/469) and 4.9% (23/469). In the MSM, 5.9% (43/723) had sex with HIV positive partners in the last month. 9.8% (103/1 049) used PrEP, and 8.7% (91/1 049) used PEP. The proportion of consistent condom use in PrEP and PEP were 34.3% (24/70) and 72.2% (39/54) respectively. Logistic regression analysis revealed that compared with those who used no PrEP/PEP, those who used PrEP/PEP were more likely to have unprotected anal sex in the last month (aOR=3.16, 95%CI:1.45-7.18), and more likely to have multiple homosexual partners in the last month (aOR=2.64, 95%CI:1.19-6.30), and compared with those who used no Rush Popper or drugs in the last month, those who used Rush Popper or drugs in the last month were more likely to have unprotected anal sex in the last month (aOR=2.34, 95%CI:1.67-3.30), and more likely to have multiple homosexual partners (aOR=2.42,95%CI:1.76-3.33). Conclusions: It is necessary to strengthen the health education to promote condom use and introduce the harm of drug use in MSM. In PrEP and PEP services, it is still necessary to suggest consistent condom use for MSM.