The timely termination of RNA polymerase II (Pol II) transcription is critical for polymerase recycling and preventing interference with the expression of the neighbouring genes. Termination of Pol II transcription involves exoribonucleolytic decay of the nascent RNA by 5'-3' exonuclease Xrn2. Xrn2 attacks the 5'-PO4-end and executes degradation of the nascent RNA generated by the endonucleolytic cleavage at the poly(A) site which eventually leads to Pol II release from DNA. However, the molecular details of when and how during this process Xrn2 interacts with the Pol II elongation complex to mediate its dissociation from DNA is not understood. Here, we demonstrate that Xrn2 interacts with Pol II and Spt5, a conserved transcription factor that controls Pol II processivity and pausing. Importantly, Xrn2 activity is stimulated by Spt5 in vitro and Spt5-depleted cells show defective transcription termination. Our results support a model where Xrn2 first forms a stable complex with the elongating Pol II to acquire its full activity in degrading nascent RNA. Spt5 also promotes premature termination attenuating the expression of non-coding transcripts. By contrast, Spt5 depletion leads to Pol II retention at promoters of protein-coding genes. Pol IIs that transcribe into a gene body in the absence of Spt5 exhibit severely reduced elongation rates and defective pre-mRNA processing. We propose that Spt5 plays a major role in the production of functional mRNA by directly stimulating the activity of the RNA enzymes and preventing entry of Pol II complexes not configured to support transcription and pre-mRNA processing into elongation.