Although stress has profound effects on motivated behavior, the underlying mechanisms responsible are incompletely understood. In this study we elucidate a functional pathway in mouse brain that encodes the aversive effects of stress and mediates stress-induced reinstatement of cocaine place preference (CPP). Activation of the dynorphin/kappa opioid receptor (KOR) system by either repeated stress or agonist produces conditioned place aversion (CPA). Because KOR inhibition of dopamine release in the mesolimbic pathway has been proposed to mediate the dysphoria underlying this response, we tested dopamine-deficient mice in this study and found that KOR agonist in these mice still produced CPA. However, inactivation of serotonergic KORs by injection of the KOR antagonist norBNI into the dorsal raphe nucleus (DRN), blocked aversive responses to the KOR agonist U50,488 and blocked stress-induced reinstatement of CPP. KOR knockout (KO) mice did not develop CPA to U50,488; however, lentiviral re-expression of KOR in the DRN of KOR KO mice restored place aversion. In contrast, lentiviral expression in DRN of a mutated form of KOR that fails to activate p38 MAPK required for KOR-dependent aversion, did not restore place aversion. DRN serotonergic neurons project broadly throughout the brain, but the inactivation of KOR in the nucleus accumbens (NAc) coupled with viral re-expression in the DRN of KOR KO mice demonstrated that aversion was encoded by a DRN to NAc projection. These results suggest that the adverse effects of stress may converge on the serotonergic system and offers an approach to controlling stress-induced dysphoria and relapse.