ImportanceRepeated ketamine administration is common in treatment-refractory chronic pain, but ketamine analgesic and antidepressant effects are poorly understood in patients with chronic pain with depression symptoms.ObjectiveTo determine clinical pain trajectories with repeated ketamine administrations, exploring whether ketamine dose and/or pretreatment depressive and/or anxiety symptoms may mediate pain relief.Design, Setting, and ParticipantsThis nationwide, multicenter, prospective cohort study included patients in France with treatment-refractory chronic pain who received repeated ketamine administration, over 1 year, according to ketamine use in their pain clinic. Data were collected from July 7, 2016, through September 21, 2017. Linear mixed models for repeated data, trajectory analysis, and mediation analysis were performed from November 15 to December 31, 2022.InterventionsKetamine administration in cumulative dose (milligrams) over 1 year.Main Outcomes and MeasuresPrimary outcome was mean pain intensity (0-10 on the Numerical Pain Rating Scale [NPRS]), assessed every month for 1 year by telephone, after inclusion in the hospital. Depression and anxiety (Hospital Anxiety and Depression Scale [HADS]), quality of life (12-item Short Form Health Survey [SF-12]), cumulative ketamine dose, adverse effects, and concomitant treatments were secondary outcomes.ResultsA total of 329 patients (mean [SD] age, 51.4 [11.0] years; 249 women [75.7%] and 80 men [24.3%]) were enrolled. Repeated ketamine administration was associated with a decrease of NPRS (effect size = −0.52 [95% CI, −0.62 to −0.41]; P < .001) and an increase of SF-12 mental health (39.7 [10.9] to 42.2 [11.1]; P < .001) and physical health (28.5 [7.9] to 29.5 [9.2]; P = .02) dimension scores over 1 year. Adverse effects were in the normal range. There was a significant difference between patients without and with depressive symptoms in pain diminution (regression coefficient, −0.04 [95% CI, −0.06 to −0.01]; omnibus P = .002 for interaction of time × baseline depression [HADS score ≤7 or >7]). The mediation model showed that ketamine dose was not associated with pain diminution (r = 0.01; P = .61) and not correlated with depression (r = −0.06; P = .32), and that depression was associated with pain diminution (regression coefficient, 0.03 [95% CI, 0.01-0.04]; P < .001), whereas ketamine dose was not (regression coefficient, 0.00 [95% CI, −0.01 to 0.01]; P = .67). The proportion of reduction of pain mediated by baseline depression was 64.6%.Conclusions and RelevanceThe findings of this cohort study on chronic refractory pain suggest that depression (and not ketamine dose or anxiety) was the mediator of the association of ketamine with pain diminution. This finding provides radically new insights on how ketamine reduces pain primarily by dampening depression. This reinforces the need for systematic holistic assessment of patients with chronic pain to diagnose severe depressive symptoms where ketamine would be a very valuable therapeutic option.