The unfolded protein response (UPR) is a homeostatic mechanism to maintain endoplasmic reticulum (ER) function. The UPR is activated by various physiological conditions as well as in disease states, such as cancer. As androgens regulate secretion and development of the normal prostate and drive prostate cancer (PCa) growth, they may affect UPR pathways. Here, we show that the canonical UPR pathways are directly and divergently regulated by androgens in PCa cells, through the androgen receptor (AR), which is critical for PCa survival. AR bound to gene regulatory sites and activated the IRE1α branch, but simultaneously inhibited PERK signaling. Inhibition of the IRE1α arm profoundly reduced PCa cell growth in vitro as well as tumor formation in preclinical models of PCa in vivo. Consistently, AR and UPR gene expression were correlated in human PCa, and spliced XBP-1 expression was significantly upregulated in cancer compared with normal prostate. These data establish a genetic switch orchestrated by AR that divergently regulates the UPR pathways and suggest that targeting IRE1α signaling may have therapeutic utility in PCa.