RNA primers for DNA replication are usually synthesized by specialized enzymes, the primases1. However, some replication systems have evolved to use cellular DNA-dependent RNA polymerase for primer synthesis 1,2. The main requirement for the replication primer, an exposed RNA 3′ end annealed to the DNA template, is not compatible with known conformations of the transcription elongation complex3, raising a question of how the priming is achieved. Here we show that a previously unrecognized kind of transcription complex is formed during RNA polymerase-catalysed synthesis of the M13 bacteriophage replication primer. The complex contains an overextended RNA-DNA hybrid bound in the RNA-polymerase trough that is normally occupied by downstream double-stranded DNA, thus leaving the 3′ end of the RNA available for interaction with DNA polymerase. Transcription complexes with similar topology may prime the replication of other bacterial mobile elements and may regulate transcription elongation under conditions that favour the formation of an extended RNA-DNA hybrid.