The biosynthesis of several protein cofactors is subject to feedback regulation by riboswitches. Flavin mononucleotide (FMN)-specific riboswitches, also known as RFN elements, direct expression of bacterial genes involved in the biosynthesis and transport of riboflavin (vitamin B(2)) and related compounds. Here we present the crystal structures of the Fusobacterium nucleatum riboswitch bound to FMN, riboflavin and antibiotic roseoflavin. The FMN riboswitch structure, centred on an FMN-bound six-stem junction, does not fold by collinear stacking of adjacent helices, typical for folding of large RNAs. Rather, it adopts a butterfly-like scaffold, stapled together by opposingly directed but nearly identically folded peripheral domains. FMN is positioned asymmetrically within the junctional site and is specifically bound to RNA through interactions with the isoalloxazine ring chromophore and direct and Mg(2+)-mediated contacts with the phosphate moiety. Our structural data, complemented by binding and footprinting experiments, imply a largely pre-folded tertiary RNA architecture and FMN recognition mediated by conformational transitions within the junctional binding pocket. The inherent plasticity of the FMN-binding pocket and the availability of large openings make the riboswitch an attractive target for structure-based design of FMN-like antimicrobial compounds. Our studies also explain the effects of spontaneous and antibiotic-induced deregulatory mutations and provided molecular insights into FMN-based control of gene expression in normal and riboflavin-overproducing bacterial strains.