Chronic pain in mice activates Tiam1 in pyramidal neurons in the anterior cingulate cortex, increasing the number of dendritic spines and inducing synaptic plasticity. Ketamine's antidepressant effect in chronic pain is mediated by the drug blocking Tiam1-dependent maladaptive synaptic plasticity in ACC neurons.