Histone lysine methylation is generally performed by SET domain methyltransferases and regulates chromatin structure and gene expression. Here, we identify human C21orf127 (HEMK2, N6AMT1, PrmC), a member of the seven-β-strand family of putative methyltransferases, as a novel histone lysine methyltransferase. C21orf127 functions as an obligate heterodimer with TRMT112, writing the methylation mark on lysine 12 of histone H4 (H4K12) in vitro and in vivo. We characterized H4K12 recognition by solving the crystal structure of human C21orf127–TRMT112, hereafter termed ‘lysine methyltransferase 9’ (KMT9), in complex with S-adenosyl-homocysteine and H4K12me1 peptide. Additional analyses revealed enrichment for KMT9 and H4K12me1 at the promoters of numerous genes encoding cell cycle regulators and control of cell cycle progression by KMT9. Importantly, KMT9 depletion severely affects the proliferation of androgen receptor–dependent, as well as that of castration- and enzalutamide-resistant prostate cancer cells and xenograft tumors. Our data link H4K12 methylation with KMT9-dependent regulation of androgen-independent prostate tumor cell proliferation, thereby providing a promising paradigm for the treatment of castration-resistant prostate cancer.