Introduction The Joint United Nations Programme on human immunodeficiency virus (HIV)/acquired immune deficiency syndrome has proposed the 90-90-90 targets by 2020. Human immunodeficiency virus epidemic is spreading rapidly among men who have sex with men (MSM) in China. This study investigates how the scale-up of HIV testing and treatment in achieving the targets and its cost-effectiveness. Methods We constructed a compartmental model to forecast the HIV epidemic in Chinese MSM based on various "test-and-treat" scale-up scenarios. We assessed their cost effectiveness based on the cost for each HIV infection, death, and disability-adjusted life years (DALYs) prevented by the scale-up. Results If the current epidemic continued, HIV prevalence among Chinese MSM would increase from 9.2% in 2016 to 12.6% (9.2-15.6%) in 2020 and 16.2% (11.3-20.0%) in 2025. By 2020, 49.2% of infected MSM would be diagnosed and 40.1% of whom on treatment, falling short of the 90-90-90 targets, so would be even by 2025. To achieve these targets by 2020, additional 850,000 HIV screening tests and 112,500 person-years of antiretroviral treatment (ART) annually are necessary. This spending is US 478 million during 2016 to 2020, which almost tripled the status quo. However, by delaying to 2025, an investment of US 1210 million over 2016 to 2025 corresponding to 52% increase to the status quo, will enable extra 340,000 HIV screening tests and 60,000 person-year on ART annually. In both scenarios, the incremental cost-effectiveness ratio was US 733 to 960 for each DALY prevented, indicating highly cost-effective scenarios. Conclusions Achieving the 90-90-90 targets by 2020 requires steep increase in investment, but delaying the targets to 2025 is practical and cost-effective.