Light-driven outward H+ pumps are widely distributed in nature, converting sunlight energy into proton motive force. Here we report the characterization of an oppositely directed H+ pump with a similar architecture to outward pumps. A deep-ocean marine bacterium, Parvularcula oceani, contains three rhodopsins, one of which functions as a light-driven inward H+ pump when expressed in Escherichia coli and mouse neural cells. Detailed mechanistic analyses of the purified proteins reveal that small differences in the interactions established at the active centre determine the direction of primary H+ transfer. Outward H+ pumps establish strong electrostatic interactions between the primary H+ donor and the extracellular acceptor. In the inward H+ pump these electrostatic interactions are weaker, inducing a more relaxed chromophore structure that leads to the long-distance transfer of H+ to the cytoplasmic side. These results demonstrate an elaborate molecular design to control the direction of H+ transfers in proteins.