Chronic opiate use induces opiate dependence, which is characterized by extremely unpleasant physical and emotional feelings after drug use is terminated. Both the rewarding effects of a drug and the desire to avoid withdrawal symptoms motivate continued drug use, and the nucleus accumbens is important for orchestrating both processes. While multiple inputs to the nucleus accumbens regulate reward, little is known about the nucleus accumbens circuitry underlying withdrawal. Here we identify the paraventricular nucleus of the thalamus as a prominent input to the nucleus accumbens mediating the expression of opiate-withdrawal-induced physical signs and aversive memory. Activity in the paraventricular nucleus of the thalamus to nucleus accumbens pathway is necessary and sufficient to mediate behavioural aversion. Selectively silencing this pathway abolishes aversive symptoms in two different mouse models of opiate withdrawal. Chronic morphine exposure selectively potentiates excitatory transmission between the paraventricular nucleus of the thalamus and D2-receptor-expressing medium spiny neurons via synaptic insertion of GluA2-lacking AMPA receptors. Notably, in vivo optogenetic depotentiation restores normal transmission at these synapses and robustly suppresses morphine withdrawal symptoms. This links morphine-evoked pathway- and cell-type-specific plasticity in the paraventricular nucleus of the thalamus to nucleus accumbens circuit to opiate dependence, and suggests that reprogramming this circuit holds promise for treating opiate addiction.