Despite significant progress in the treatment of patients with diffuse large B-cell lymphoma (DLBCL) and mantle cell lymphoma (MCL), the prognosis of patients with relapsed disease remains poor due to the emergence of drug resistance and subsequent disease progression. Identification of novel targets and therapeutic strategies for these diseases represents an urgent need. Here, we report that both MCL and DLBCL are exquisitely sensitive to transcription-targeting drugs, in particular THZ531, a covalent inhibitor of cyclin-dependent kinase 12 (CDK12). By implementing pharmacogenomics and a cell-based drug screen, we found that THZ531 leads to inhibition of oncogenic transcriptional programs, especially the DNA damage response pathway, MYC target genes and the mTOR-4EBP1-MCL-1 axis, contributing to dramatic lymphoma suppression in vitro. We also identified de novo and established acquired THZ531-resistant lymphoma cells conferred by over-activation of the MEK-ERK and PI3K-AKT-mTOR pathways and upregulation of multidrug resistance-1 (MDR1) protein. Of note, EZH2 inhibitors reversed resistance to THZ531 by competitive inhibition of MDR1 and, in combination with THZ531, synergistically inhibited MCL and DLBCL growth in vitro. Our study indicates that CDK12 inhibitors, alone or together with EZH2 inhibitors, offer promise as novel effective approaches for difficult-to-treat DLBCL and MCL.