Objective: to analyze the association between depression, anxiety, and burnout with the risk of academic desertion, and ideation of academic desertion in medical residents. Methods: Cross-sectional study with a sample of 200 medical residents in Mexico City. Maslach, Beck, and Hamilton scales were used to assess burnout, depression, and anxiety, respectively. The main variable was academic desertion. Statistical analysis included descriptive and inferential methods; risk was assessed by odds ratio (OR). Multivariate models were used to explore associations, with statistical significance considered at p <0.05. Results: The frequency of depression, anxiety, and burnout was 17% (n= 34), 26.5% (n= 53), and 19.5% (n= 39), respectively. The presence of depression was associated with up to a fourfold and sixfold increase in desertion and desertion ideation, respectively (OR= 4.04, 95% CI 1.41 - 11.5, p= 0.006, or 6.5, 95% CI 2.9 - 14.6, p= 0.000). Anxiety showed no association with turnover (OR= 1.02, 95% ci 0.26 - 4.01, p= 0.967). The presence of burnout doubled the risk (OR= 2.2, 95% CI 1.07 - 4.52, p= 0.001). In the multiple analysis, depression increased the risk of dropping out up to fourfold. Conclusion: The presence of depression was the disorder most associated with dropout and dropout ideation. It is necessary to establish prevention, and detection programs at medical residency sites.