Three classes of ion-driven protein motors have been identified to date: ATP synthase, the bacterial flagellar motor and a proton-driven motor that powers gliding motility and the type 9 protein secretion system in Bacteroidetes bacteria. Here, we present cryo-electron microscopy structures of the gliding motility/type 9 protein secretion system motors GldLM from Flavobacterium johnsoniae and PorLM from Porphyromonas gingivalis. The motor is an asymmetric inner membrane protein complex in which the single transmembrane helices of two periplasm-spanning GldM/PorM proteins are positioned inside a ring of five GldL/PorL proteins. Mutagenesis and single-molecule tracking identify protonatable amino acid residues in the transmembrane domain of the complex that are important for motor function. Our data provide evidence for a mechanism in which proton flow results in rotation of the periplasm-spanning GldM/PorM dimer inside the intra-membrane GldL/PorL ring to drive processes at the bacterial outer membrane.