BACKGROUND: Coronavirus disease 2019 (COVID-19) has caused a serious epidemic around the world, but it has been effectively controlled in the mainland of China. The Chinese government limited the migration of people almost from all walks of life. Medical workers have rushed into Hubei province to fight against the epidemic. Any activity that can increase infection is prohibited. The aim of this study was to confirm that timely lockdown, large-scale case-screening and other control measures proposed by the Chinese government were effective to contain the spread of the virus in the mainland of China. METHODS: Based on disease transmission-related parameters, this study was designed to predict the trend of COVID-19 epidemic in the mainland of China and provide theoretical basis for current prevention and control. An SEIQR epidemiological model incorporating asymptomatic transmission, short term immunity and imperfect isolation was constructed to evaluate the transmission dynamics of COVID-19 inside and outside of Hubei province. With COVID-19 cases confirmed by the National Health Commission (NHC), the optimal parameters of the model were set by calculating the minimum Chi-square value. RESULTS: Before the migration to and from Wuhan was cut off, the basic reproduction number in China was 5.6015. From 23 January to 26 January 2020, the basic reproduction number in China was 6.6037. From 27 January to 11 February 2020, the basic reproduction number outside Hubei province dropped below 1, but that in Hubei province remained 3.7732. Because of stricter controlling measures, especially after the initiation of the large-scale case-screening, the epidemic rampancy in Hubei has also been contained. The average basic reproduction number in Hubei province was 3.4094 as of 25 February 2020. We estimated the cumulative number of confirmed cases nationwide was 82 186, and 69 230 in Hubei province on 9 April 2020. CONCLUSIONS: The lockdown of Hubei province significantly reduced the basic reproduction number. The large-scale case-screening also showed the effectiveness in the epidemic control. This study provided experiences that could be replicated in other countries suffering from the epidemic. Although the epidemic is subsiding in China, the controlling efforts should not be terminated before May.