Basal-like breast cancer (BLBC) is the most malignant subtype of breast cancer because of its aggressive clinical behaviour and lack of effective targeted agents. Krüppel-like factor 5 (KLF5) is an oncogenic transcription factor that is highly expressed in BLBC. The deubiquitinase (DUB) BRCA1-associated protein 1 (BAP1) stabilizes KLF5 and promotes BLBC growth and metastasis. Therefore, pharmacological inhibition of the BAP1‒KLF5 axis is an effective therapeutic strategy for BLBC. Here, through screening, we identified a series of tetrahydro-β-carboline derivatives that effectively reduced the protein expression of KLF5 and exhibited strong antitumour activity. Among the investigated compounds, the lead compound LN-439A presented the strongest antitumour activity and inhibitory effect on KLF5 expression. LN-439A suppressed the proliferation and migration of BLBC cells, induced G2/M arrest, and induced apoptosis. Mechanistically, LN-439A functions as a small molecule catalytic inhibitor of BAP1 by binding to the catalytic pocket of BAP1, leading to the ubiquitination and degradation of KLF5. Consistent with this finding, the overexpression of KLF5 suppressed the antitumour effects of LN-439A. In summary, LN-439A is a promising therapeutic agent for BLBC that functions by targeting the BAP1‒KLF5 axis.