Steroidal C-17 nitrogen-containing heterocycles of Formula I:wherein: the ABCD ring structure is the nucleus of a steroid, or an analog thereof, X is a group capable of coordinating a heme group of CYP17, and Y is an hydroxyl functionality, a suitable ester, or a prodrug group, for the treatment of urogenital and/or androgen-related cancers, such as castration-resistant prostate cancer. The invention provides methods of synthesizing new chemical entities and methods of using the same in treating urogenital and/or androgen-related cancers.