Background: The rapid outbreak of coronavirus disease 2019 (COVID-19) posed a serious threat to China, followed by compulsive measures taken against the national emergency to control its further spread. This study was designed to describe residents' knowledge, attitudes, and practice behaviors (KAP) during the outbreak of COVID-19.Methods: An anonymous online questionnaire was randomly administrated to residents in mainland China between Mar 7 and Mar 16, 2020. Residents' responses to KAP were quantified by descriptive and stratified analyses. A Multiple Logistic Regression model was employed to identify risk factors associated with KAP scores.Results: A total of 10,195 participants were enrolled from 32 provinces of China. Participants of the ≥61 years group had higher KAP scores [adjusted Odds Ratio (ORadj) = 4.8, 95% Confidence Interval (CI): 3.0–7.7, P < 0.0001], and the married participants and those in low-income families had higher scores of KAP (ORadj = 1.2, 95% CI: 1.1–1.3; ORadj = 1.8, 95% CI: 1.6–2.2, respectively, both P < 0.0001). The participants living with more than two family members had higher scores in an increasing ORs when the family members increased (ORadj = 1.3, 95% CI: 1.1–1.6, P = 0.013; ORadj = 1.3, 95% CI: 1.1–1.6, P = 0.003; ORadj = 1.3, 95% CI: 1.0–1.6, P = 0.02; for groups of 2, 3–4 and ≥5, respectively).Conclusions: Out of the enrolled participants who completed the survey, 85.5% responded positively toward the mandatory public health interventions implemented nationwide by the Chinese authorities. These effective practices seem to be related to a proper attitude generated by the increased knowledge and better awareness of the risks related to the COVID-19 pandemic and the consequent need for safe and responsible behavior.