Abstract The nuclear export of mRNA is an important step in eukaryotic gene expression 1 . Despite recent molecular insights into how newly transcribed mRNAs are packaged into ribonucleoprotein complexes (mRNPs) 2,3 , the subsequent events that govern mRNA export are poorly understood. Here we uncover the molecular basis underlying key events of human mRNA export, including the remodelling of mRNP-bound transcription–export complexes (TREX), the formation of export-competent mRNPs, the docking of mRNPs at the nuclear pore complex (NPC), and the release of mRNPs at the NPC to initiate their export. Our biochemical and structural data show that the ATPase UAP56 (also known as DDX39) acts as a central molecular switch that directs nucleoplasmic mRNPs from TREX to NPC-anchored TREX-2 complexes through its ATP-gated mRNA-binding cycle. Collectively, these findings establish a mechanistic framework for a general and evolutionarily conserved mRNA export pathway.