Presence of chronic non-cancer pain conditions (CNPC) among adults with major depressive disorder (MDD) often reduces benefits of antidepressant therapy, thereby increasing the possibility of treatment resistance. This study sought to identify leading predictors of treatment resistant depression (TRD) among adults with MDD and CNPC using machine learning approaches. This retrospective dynamic cohort study included adult patients (≥18 years) with CNPC and newly diagnosed MDD on antidepressant therapy from a de-identified 10% sample of Optum® Clinformatics® Data Mart (2007-2017). TRD was identified using the Massachusetts General Hospital clinical staging algorithm for claims data. The study population was divided into a 70% training sample and a 30% test/validation sample. Leading predictors of TRD were identified using random forest (RF) and logistic regression (LR) approaches, including a total of 42 demographic, health- and treatment-related features. A fully adjusted model and model with top 20 features were built using Caret and randomForest packages for R software. Overall, a total of 23,645 patients were included (mean age 55 years, 73% female; 78% had ≥2 CNPC, 91% joint pain/arthritis and 71% back/neck pain), and 11.4% (N=2,684) had TRD. Compared to patients without TRD, those with TRD were younger and more likely to have anxiety and/or substance use disorder (all p<0.001). Application of LR and RF resulted in an AUC of 0.711 and 0.704, respectively, for the fully-adjusted model (11.47% OOB error), and AUC of 0.704 and 0.701 for the model with 20 features. Mental health specialist visits, polypharmacy (≥5 medications), psychotherapy use, anxiety, and younger age were the top five predictors of TRD, with AORs ranging from 1.9-1.3 (95% CI = 1.13-2.18, P≤0.001). Machine learning identified several modifiable factors that predicted TRD in adults with CNPC. These factors may serve as targets of further investigation or clinical intervention to improve treatment outcomes in this population.