In late December 2019, patients of atypical pneumonia due to an unidentified microbial agent were reported in Wuhan, Hubei Province, China. Subsequently, a novel coronavirus was identified as the causative pathogen which was named SARS-CoV-2. As of 12 February 2020, more than 44 000 cases of SARS-CoV-2 infection have been confirmed in China and continue to expand. Provinces, municipalities and autonomous regions of China have launched first-level response to major public health emergencies one after another from 23 January 2020, which means restricting movement of people among provinces, municipalities and autonomous regions. The aim of this study was to explore the correlation between the migration scale index and the number of confirmed coronavirus disease 2019 (COVID-19) cases and to depict the effect of restricting population movement. In this study, Excel 2010 was used to demonstrate the temporal distribution at the day level and SPSS 23.0 was used to analyse the correlation between the migration scale index and the number of confirmed COVID-19 cases. We found that since 23 January 2020, Wuhan migration scale index has dropped significantly and since 26 January 2020, Hubei province migration scale index has dropped significantly. New confirmed COVID-19 cases per day in China except for Wuhan gradually increased since 24 January 2020, and showed a downward trend from 6 February 2020. New confirmed COVID-19 cases per day in China except for Hubei province gradually increased since 24 January 2020, and maintained at a high level from 24 January 2020 to 4 February 2020, then showed a downward trend. Wuhan migration scale index from 9 January to 22 January, 10 January to 23 January and 11 January to 24 January was correlated with the number of new confirmed COVID-19 cases per day in China except for Wuhan from 22 January to 4 February. Hubei province migration scale index from 10 January to 23 January and 11 January to 24 January was correlated with the number of new confirmed COVID-19 cases per day in China except for Hubei province from 22 January to 4 February. Our findings suggested that people who left Wuhan from 9 January to 22 January, and those who left Hubei province from 10 January to 24 January, led to the outbreak in the rest of China. The ‘Wuhan lockdown’ and the launching of the first-level response to this major public health emergency may have had a good effect on controlling the COVID-19 epidemic. Although new COVID-19 cases continued to be confirmed in China outside Wuhan and Hubei provinces, in our opinion, these are second-generation cases.