Treatment of prostate cancer (PC) by androgen suppression promotes the emergence of aggressive variants that are androgen receptor (AR) independent. Here we identify the transcription factor ONECUT2 (OC2) as a master regulator of AR networks in metastatic castration-resistant prostate cancer (mCRPC). OC2 acts as a survival factor in mCRPC models, suppresses the AR transcriptional program by direct regulation of AR target genes and the AR licensing factor FOXA1, and activates genes associated with neural differentiation and progression to lethal disease. OC2 appears active in a substantial subset of human prostate adenocarcinoma and neuroendocrine tumors. Inhibition of OC2 by a newly identified small molecule suppresses metastasis in mice. These findings suggest that OC2 displaces AR-dependent growth and survival mechanisms in many cases where AR remains expressed, but where its activity is bypassed. OC2 is also a potential drug target in the metastatic phase of aggressive PC.