Early life stress increases risk for depression. Here we establish a “two-hit” stress model in mice wherein stress at a specific postnatal period increases susceptibility to adult social defeat stress and causes long-lasting transcriptional alterations that prime the ventral tegmental area (VTA)—a brain reward region—to be in a depression-like state. We identify a role for the developmental transcription factor orthodenticle homeobox 2 (Otx2) as an upstream mediator of these enduring effects. Transient juvenile—but not adult—knockdown of Otx2 in VTA mimics early life stress by increasing stress susceptibility, whereas its overexpression reverses the effects of early life stress. This work establishes a mechanism by which early life stress encodes lifelong susceptibility to stress via long-lasting transcriptional programming in VTA mediated by Otx2.