Steroidogenesis-mediated production of neurosteroids is important for brain homeostasis. Cytochrome P450 17A1 (CYP17A1), which converts pregnenolone to dehydroepiandrosterone (DHEA) in endocrine organs and the brain, is required for prostate cancer progression and acquired chemotherapeutic resistance. However, whether CYP17A1-mediated DHEA synthesis is involved in brain tumor malignancy, especially in glioma, the most prevalent brain tumor, is unknown. To investigate the role of CYP17A1 in glioma, we determined that CYP17A1 expression is significantly increased in gliomas, which secrete more DHEA than normal astrocytes. We found that as gliomas became more malignant, both CYP17A1 and DHEA were significantly upregulated in temozolomide (TMZ)-resistant cells and highly invasive cells. In particular, the increase of CYP17A1 was caused by Sp1-mediated DNA demethylation, whereby Sp1 competed with DNMT3a for binding to the CYP17A1 promoter in TMZ-resistant glioma cells. CYP17A1 was required for the development of glioma cell invasiveness and resistance to TMZ-induced cytotoxicity. In addition, DHEA markedly attenuated TMZ-induced DNA damage and apoptosis. Together, our results suggest that components of the Sp1-CYP17A1-DHEA axis, which promotes the development of TMZ resistance, may serve as potential biomarkers and therapeutic targets in recurrent glioma.