Incompletely processed and misprocessed mRNAs as well as numerous noncoding RNAs are retained in the nucleus and often degraded, and defects in this quality control mechanism have been linked to various diseases, including cancer and neurodegeneration. However, the underlying mechanisms remain poorly understood. Here we show that LENG8 is recruited to pre-mRNAs by splicing factors, including the U1 snRNP. Once RNA-bound, LENG8 is both necessary and sufficient to sequester RNA in the nucleus. LENG8 depletion leads to the leakage of misprocessed mRNAs, including intronically polyadenylated and intron-retained mRNAs, as well as noncoding RNAs into the cytoplasm. Mechanistically, we showed that LENG8 binds to PCID2 and SEM1 to form an evolutionarily conserved complex, referred to as REX (repressor of export), and causes RNA nuclear retention by acting as a dominant negative factor for the essential mRNA export factor TREX2. Finally, LENG8 promotes RNA degradation by recruiting the ZFC3H1-MTR4-exosome complex. Thus, LENG8 is a key quality control factor that keeps pre-mRNAs in the nucleus until they are fully and correctly processed.