Schematic comparison of the three different basal body structures of eubacterial flagella with the putative ancestral junctional pore complex and the related type III secretion injector. The exoflagella of Proteobacteria and Planctobacteria (Exoflagellata), Sphingobacteria, and Eurybacteria project through the outer membrane, with which they are associated by a lipoprotein L-ring (made of FlgH protein units). Spirochaetes have endoflagella within the periplasmic space that do not penetrate the outer membrane and thus need no L-ring. Exoflagella and spirochaete endoflagella both have a P-ring (made of FlgI protein units) thought to act as a bushing for free rotation within the thin peptidoglycan wall (sacculus). Both P-ring and L-ring are absent from the exoflagella of Posibacteria (Actinobacteria and Endobacteria). Posibacterial flagella would automatically have become external when the ancestral outer membrane was lost. The more complex multiprotein shaft of spirochaetes, clearly a derived character (see text) is shown by its greater thickness. If junctional pore complexes also use a basal type III secretion apparatus, flagella and type III injectors probably evolved from them independently. If junctional pore complexes lack type III secretion homologues, it is likely that they evolved during the origin of flagella only and that type III injectors evolved later in the ancestral exoflagellate by simplification of flagella (dashed arrow); see text for discussion. The diagram assumes that ExbB/TonB/OmpA only associated with the basal body of the flagella and evolved into the flagellar stator MotAB during the origin of flagella.