The TrkH/TrkG/KtrB proteins mediate K(+) uptake in bacteria and probably evolved from simple K(+) channels by multiple gene duplications or fusions. Here we present the crystal structure of a TrkH from Vibrio parahaemolyticus. TrkH is a homodimer, and each protomer contains an ion permeation pathway. A selectivity filter, similar in architecture to those of K(+) channels but significantly shorter, is lined by backbone and side-chain oxygen atoms. Functional studies showed that TrkH is selective for permeation of K(+) and Rb(+) over smaller ions such as Na(+) or Li(+). Immediately intracellular to the selectivity filter are an intramembrane loop and an arginine residue, both highly conserved, which constrict the permeation pathway. Substituting the arginine with an alanine significantly increases the rate of K(+) flux. These results reveal the molecular basis of K(+) selectivity and suggest a novel gating mechanism for this large and important family of membrane transport proteins.