The neurobiological mechanisms underlying the induction and remission of depressive episodes over time are not well understood. Through repeated longitudinal imaging of medial prefrontal microcircuits in the living brain, we found that prefrontal spinogenesis plays a critical role in sustaining specific antidepressant behavioral effects and maintaining long-term behavioral remission. Depression-related behavior was associated with targeted, branch-specific elimination of postsynaptic dendritic spines on prefrontal projection neurons. Antidepressant-dose ketamine reversed these effects by selectively rescuing eliminated spines and restoring coordinated activity in multicellular ensembles that predict motivated escape behavior. Prefrontal spinogenesis was required for the long-term maintenance of antidepressant effects on motivated escape behavior but not for their initial induction.