Microglia are activated in many neurological diseases and have been suggested to play an important role in the development of affective disorders including major depression. To investigate how microglial signaling regulates mood, we used bidirectional chemogenetic manipulations of microglial activity in mice. Activation of microglia in the dorsal striatum induced local cytokine expression and a negative affective state characterized by anhedonia and aversion, whereas inactivation of microglia blocked aversion induced by systemic inflammation. Interleukin-6 signaling and cyclooxygenase-1 mediated prostaglandin synthesis in the microglia were critical for the inflammation-induced aversion. Correspondingly, microglial activation led to a prostaglandin-dependent reduction of the excitability of striatal neurons. These findings demonstrate a mechanism by which microglial activation causes negative affect through prostaglandin-dependent modulation of striatal neurons and indicate that interference with this mechanism could milden the depressive symptoms in somatic and psychiatric diseases involving microglial activation.