The bacterial flagellar motor is a self-assembling supramolecular nanodevice.Its spontaneous biosynthesis is initiated by the insertion of the MS ring protein FliF into the inner membrane, followed by attachment of the switch protein FliG. Assembly of this multiprotein complex is tightly regulated to avoid nonspecific aggregation, but the molecular mechanisms governing flagellar assembly are unclear. Here, we present the crystal structure of the cytoplasmic domain of FliF complexed with the Nterminal domain of FliG (FliF C -FliG N ) from the bacterium Helicobacter pylori. Within this complex, FliF C interacted with FliG N through extensive hydrophobic contacts similar to those observed in the FliF C -FliG N structure from the thermophile Thermotoga maritima, indicating conservation of the FliF C -FliG N interaction across bacterial species. Analysis of the crystal lattice revealed that the heterodimeric complex packs as a linear superhelix via stacking of the armadillo-repeat-like motifs (ARM) of FliG N . Notably, this linear helix was similar to that observed for the assembly of the FliG middle domain. We validated the in vivo relevance of the FliG N stacking by complementation studies in Escherichia coli. Furthermore, structural comparison with apo FliG from the thermophile Aquifex aeolicus indicated that FliF regulates the conformational transition of FliG and exposes the complementary ARM-like motifs of FliG N , containing conserved hydrophobic residues. FliF apparently both provides a template for FliG polymerization and spatiotemporally controls subunit interactions within FliG. Our findings reveal that a small protein fold can serve as a versatile building block to assemble into a multiprotein machinery of distinct shapes for specific functions.The bacterial flagellar motor is a self-assembled reversible rotary nanodevice. This dynamic rotary motor of about 40 nm in diameter is composed of rings of protein oligomers: the L ring (outer membrane), P ring (peptidoglycan layer), MS ring (inner membrane) and C ring (cytoplasm) (1,2). The L and P rings are believed to act as a bushing through which a central rotating rod can pass. The MS and C rings contribute to the rotor part of the flagellar motor. Torque is generated by a membrane-bound stator, which converts electrochemical potential into mechanical force that acts on the rotor. The synthesis of the flagellum begins at the rotor, which is composed of the MS and C ring protein subassemblies ( Figure 1). Specifically, the assembly of the MS ring protein FliF prompts the incorporation of the switch protein FliG and subsequently the proteins FliM and FliN to form the cytoplasmic motor switch complex. The MS ring plays an important role as it interacts both with the rod where the flagellum is anchored and with the C ring where torque Crystal structure of FliF-FliG complex from H. pylori generation and rotation switching take place.In Salmonella typhimurium and Escherichia coli, there are about 26 copies of FliF in the MS ring and 26 copies of FliG, 34 c...