Bacteria swim using a flagellar motor that is powered by stator units. These stator units are energized by an ionic gradient across the membrane, typically proton or sodium. The presumed monodirectional rotation of the stator units allows the bidirectional rotation of the flagellar motor. However, how ion selectivity is attained, how ion transport triggers the directional rotation of the stator unit, and how the stator unit is incorporated into the motor remain largely unclear. Here we have determined by cryo-electron microscopy the structure of the Na+-driven type stator unit PomAB from the gram-negative bacterium Vibrio alginolyticus in both lipidic and detergent environments, at a resolution up to 2.5 Å. The structure is in a plugged, auto-inhibited state consisting of five PomA subunits surrounding two PomB subunits. The electrostatic potential map uncovers sodium ion binding sites within the transmembrane domain, which together with functional experiments and explicit solvent molecular dynamics simulations, suggest a mechanism for ion translocation and selectivity. Resolved conformational isomers of bulky hydrophobic residues from PomA, in the vicinity of key determinant residues for sodium ion coupling of PomB, prime PomA for clockwise rotation. The rotation is tightly blocked by the trans-mode organization of the PomB plug motifs. The structure also reveals a conformationally dynamic helical motif at the C-terminus of PomA, which we propose regulates the distance between PomA subunit cytoplasmic domains and is involved in stator unit-rotor interaction, concomitant stator unit activation, and torque transmission. Together, our studies provide mechanistic insight for understanding flagellar stator unit ion selectivity and incorporation of the stator units into the motor.