The bacterial flagellum is a locomotive organelle that propels the bacterial cell body in liquid environments. The flagellum is a supramolecular complex composed of about 30 different proteins and consists of at least three parts: a rotary motor, a universal joint, and a helical filament. The flagellar motor of Escherichia coli and Salmonella enterica is powered by an inward-directed electrochemical potential difference of protons across the cytoplasmic membrane. The flagellar motor consists of a rotor made of FliF, FliG, FliM and FliN and a dozen stators consisting of MotA and MotB. FliG, FliM and FliN also act as a molecular switch, enabling the motor to spin in both counterclockwise and clockwise directions. Each stator is anchored to the peptidoglycan layer through the C-terminal periplasmic domain of MotB and acts as a proton channel to couple the proton flow through the channel with torque generation. Highly conserved charged residues at the rotor-stator interface are required not only for torque generation but also for stator assembly around the rotor. In this review, we will summarize our current understanding of the structure and function of the proton-driven bacterial flagellar motor.