Background: The COVID-19 pandemic is a significant health threat. Health care worker (HCWs) are at a significant risk of infection which may cause high levels of psychological distress. The aim of this study was to investigate the psychological impact of the COVID-19 on HCWs and factors which were associated with these stresses during the first outbreak in Shanghai.Methods: Between February 9 and 21, 2020, a total of 3,114 frontline HCWs from 26 hospitals in Shanghai completed an online survey. The questionnaire included questions on their sociodemographic characteristics, 15 stress-related questions, and General Health Questionnaire-12 (GHQ-12). Exploratory factor analysis was applied to the 15 stress-related questions which produced four distinct factors for evaluation. Multiple linear regression models were performed to explore the association of personal characteristics with each score of the four factors. Binary logistic analysis was used to explain the association of personal characteristics and these four factors with the GHQ-12.Results: There were 2,691 valid surveys received. The prevalence of emotional distress (defined as GHQ-12 ≥ 12) was noted in 47.7% (95%CI:45.7–49.6%) HCWs. Females (OR = 1.43, 95%CI:1.09–1.86) were more likely to have a psychological distress than males. However, HCWs who work in secondary hospitals (OR = 0.71, 95% CI:0.58–0.87) or had a no contact history (OR = 0.45, 95%CI: 0.35–0.58) were less likely to suffer psychological distress. HCWs who were nurses, married, and had a known contact history were highly likely to have anxiety. HCWs working at tertiary hospitals felt an elevated anxiety regarding the infection, a lack of knowledge, and less protected compared to those who worked at secondary hospitals.Conclusions: Our study shows that the frontline HCWs had a significant psychosocial distress during the COVID-19 outbreak in Shanghai. HCWs felt a lack of knowledge and had feelings of being not protected. It is necessary for hospitals and governments to provide additional trainings and psychological counseling to support the first-line HCWs.