Overgeneralization of fear to harmless situations is a core feature of anxiety disorders resulting from acute stress, yet the mechanisms by which fear becomes generalized are poorly understood. In this study, we show that generalized fear in mice results from a transmitter switch from glutamate to γ-aminobutyric acid (GABA) in serotonergic neurons of the lateral wings of the dorsal raphe. Similar change in transmitter identity was found in the postmortem brains of individuals with posttraumatic stress disorder (PTSD). Overriding the transmitter switch in mice prevented the acquisition of generalized fear. Corticosterone release and activation of glucocorticoid receptors mediated the switch, and prompt antidepressant treatment blocked the cotransmitter switch and generalized fear. Our results provide important insight into the mechanisms involved in fear generalization.