Messenger RNA is produced by RNA polymerase II (pol II) transcription, followed by processing of the primary transcript. Transcription, splicing and cleavage-polyadenylation can occur independently in vitro, but we demonstrate here that these processes are intimately linked in vivo. We show that the carboxy-terminal domain (CTD) of the pol II large subunit is required for efficient RNA processing. Splicing, processing of the 3' end and termination of transcription downstream of the poly(A) site, are all inhibited by truncation of the CTD. We found that the cleavage-polyadenylation factors CPSF and CstF specifically bound to CTD affinity columns and copurified with pol II in a high-molecular-mass complex. Our demonstration of an association between the CTD and 3'-processing factors, considered together with reports of a similar interaction with splicing factors, suggests that an mRNA 'factory' exists which carries out coupled transcription, splicing and cleavage-polyadenylation of mRNA precursors.