Highly pathogenic avian influenza viruses (HPAIVs) derive from H5 and H7 low pathogenic avian influenza viruses (LPAIVs). Although insertion of a furin-cleavable multibasic cleavage site (MBCS) in the hemagglutinin gene was identified decades ago as the genetic basis for the LPAIV-to-HPAIV transition, the mechanisms underlying the occurrence of insertion are unknown. Here, we show that transient H5 RNA structures, predicted to trap the influenza virus polymerase on purine-rich sequences, drive nucleotide insertions, providing empirical evidence of RNA structure involvement in MBCS acquisition. Introduction of H5-like sequences and structures into an H6 hemagglutinin resulted in MBCS-yielding insertions. Our results show that nucleotide insertions that underlie H5 HPAIV emergence result from an RNA structure-driven diversity-generating mechanism, which could also occur in other RNA viruses.