Psychological stress may lead to erectile dysfunction (ED), and inflammation has been evaluated as a major contributing factor. The goal of this study was to investigate the effects of etanercept (ETN), an anti-tumor necrosis factor alpha (TNF-alpha) protein, on cavernosal function in the unpredictable chronic mild stress (UCMS) rat model of depression. Animals were divided into 4 groups: animals not exposed to UCMS, animals not exposed to UCMS and treated with ETN, animals exposed to UCMS, and animals treated with ETN while exposed to UCMS. UCMS significantly impaired the neurogenic and endothelium-dependent relaxation responses; reduced cavernosal endothelial nitric oxide (NO) synthase (eNOS) and neuronal NO synthase (nNOS) expressions; decreased testosterone levels; enhanced systemic levels of corticosterone, TNF-alpha, interleukin 1 beta (IL-1 beta), interleukin 6 (IL-6), monocyte chemoattractant protein-1 (MCP-1), and intercellular adhesion molecule 1 (ICAM-1); and also increased cavernosal levels of TNF-alpha, IL-1 beta, and IL-6 in rats. ETN administration restored NO-mediated neurogenic and endothelium-dependent relaxation responses of the corpus cavernosum, increased cavernosal eNOS and nNOS expressions, enhanced testosterone levels, and decreased corticosterone levels in UCMS-exposed rats. Also, systemic inflammatory markers and cavernosal proinflammatory cytokine levels were reduced by ETN. Our results demonstrate the role of TNF-alpha-mediated inflammation in the development of depression and ED in rats exposed to chronic stress.