Transcription-coupled DNA repair (TCR) efficiently removes bulky DNA lesions from transcribed parts of the genome and constitutes a major defence against DNA damage by UV irradiation. TCR begins when RNA polymerase II (Pol II) stalls at a DNA lesion and recruits the Cockayne syndrome protein CsB, the E3 ubiquitin ligase complex CRL4CsA, and the UV-stimulated scaffold protein A (UVSSA). Here we provide five high-resolution structures of Pol II transcription complexes with bound TCR factors and complementary biochemical data. Together with published work, our results converge on a model for the molecular mechanism of transcription-DNA repair coupling. In this model, Pol II stalling triggers the formation of an alternative transcription elongation complex that we call ECact. In ECact, CsB has replaced the elongation factor DSIF, binds the PAF1 complex, and repositions upstream DNA such that it contacts the elongation factor SPT6. The CsB translocase now pulls on the upstream DNA template, thereby pushing Pol II forward. If the lesion cannot be bypassed, Pol II gets stably stalled. CRL4CsA spans over the Pol II clamp to reach the Pol II jaw and direct ubiquitination of RPB1 residue lysine-1268. This triggers the recruitment of TFIIH to UVSSA, which is located at downstream DNA, and enables nucleotide excision repair. Finally, large-scale conformational changes in CRL4CsA enable ubiquitination of CsB and the release of TCR factors, thereby allowing Pol II to resume elongation and continue transcription over repaired DNA.