Background: The purpose of this study was to assess the mental health status of medical students engaged in online learning at home during the pandemic, and explore the potential risk factors of mental health.Methods: A cross-sectional study was conducted via an online survey among 5,100 medical students from Wannan Medical College in China. The Depression, Anxiety and Stress scale (DASS-21) was used to measure self-reported symptoms of depression, anxiety, and stress among medical students during online learning in the pandemic.Results: In total, 4,115 participants were included in the study. The prevalence symptoms of depression, anxiety, and stress were 31.9, 32.9, and 14.6%, respectively. Depression was associated with gender, grade, length of schooling, relationship with father, students' daily online learning time, and students' satisfaction with online learning effects. Anxiety was associated with gender, length of schooling, relationship with father, relationship between parents, students' daily online learning time, and students' satisfaction with online learning effects. Stress was associated with grade, relationship with father, relationship between parents, students' daily online learning time, and students' satisfaction with online learning effects.Conclusions: Nearly one-third of medical students survived with varying degrees of depression, anxiety, and stress symptoms during online learning of the COVID-19 pandemic. Gender, grade, length of schooling, family environment, and online learning environment play vital roles in medical students' mental health. Families and schools should provide targeted psychological counseling to high-risk students (male, second-year and third-year, four-year program). The findings of this study can provide reference for educators to cope with the psychological problems and formulate the mental health curriculum construction among medical students during online learning.