RNA synthesis is central to life, and RNA polymerase (RNAP) depends on accessory factors for recovery from stalled states and adaptation to environmental changes. Here, we investigated the mechanism by which a helicase-like factor HelD recycles RNAP. We report a cryo-EM structure of a complex between the Mycobacterium smegmatis RNAP and HelD. The crescent-shaped HelD simultaneously penetrates deep into two RNAP channels that are responsible for nucleic acids binding and substrate delivery to the active site, thereby locking RNAP in an inactive state. We show that HelD prevents non-specific interactions between RNAP and DNA and dissociates stalled transcription elongation complexes. The liberated RNAP can either stay dormant, sequestered by HelD, or upon HelD release, restart transcription. Our results provide insights into the architecture and regulation of the highly medically-relevant mycobacterial transcription machinery and define HelD as a clearing factor that releases RNAP from nonfunctional complexes with nucleic acids.