BackgroundThe COVID-19 pandemic put healthcare professionals, including residents (postgraduate trainees of health professions), under intense physical and psychological stress, hence at risk for mental disorders. We evaluated the prevalence of mental disorders among healthcare residents during the pandemic.MethodsFrom July to September 2020, residents in medicine and other healthcare specialties in Brazil were recruited. The participants completed electronic forms with validated questionnaires (DASS-21, PHQ-9, BRCS) to screen for depression, anxiety, and stress, and to evaluate resilience. Data on potential predisposing factors for mental disorders were also collected. Descriptive statistics, chi-squared, students t, correlation and logistic regression models were applied. The study received ethical approval, and all participants provided informed consent.ResultsWe included 1313 participants (51.3% medical; 48.7% nonmedical) from 135 Brazilian hospitals; mean (SD) age: 27.8 (4.4) years; 78.2% females; 59.3% white race. Of all participants, 51.3%, 53.4% and 52.6% presented symptoms consistent with depression, anxiety, and stress, respectively; 61.9% showed low resilience. Nonmedical residents exhibited higher anxiety compared to medical residents (DASS-21 anxiety score, mean difference: 2.26; 95% CI: 1.15–3.37; p < 0.001). In multivariate analyses, having any pre-existent, nonpsychiatric chronic disease was associated with higher prevalence of symptoms indicative of depression (odds ratio, OR: 2.05; 95% CI: 1.47–2.85, on DASS-21 | OR: 2.26; 95% CI: 1.59–3.20, on PHQ-9), anxiety (OR: 2.07; 95% CI: 1.51–2.83, on DASS-21), and stress (OR: 1.53; 95% CI: 1.12–2.09, on DASS-21); other predisposing factors were identified; by contrast, high resilience (BRCS score) was protective against symptoms of depression (OR 0.82; 95% CI: 0.79–0.85, on DASS-21 | OR 0.85; 95% CI: 0.82–0.88, on PHQ-9), anxiety (OR 0.90; 95% CI: 0.87–0.93, on DASS-21), and stress (OR 0.88; 95% CI: 0.85–0.91, on DASS-21); p < 0.05 for all outcomes.ConclusionsWe found a high prevalence of mental disorder symptoms among healthcare residents during COVID-19 pandemic in Brazil. Nonmedical residents exhibited higher levels of anxiety than medical ones. Some predisposing factors for depression, anxiety and stress among residents were identified.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12909-023-04202-7.