The urea channel ofHelicobacterpylori(HpUreI) is an ideal drug target for preventing gastric cancer but incomplete understanding of its gating mechanism has hampered development of inhibitors for the eradication ofH. pylori. Here, we present the cryo-EM structures ofHpUreI in closed and open conformations, both at a resolution of 2.7 Å. Our hexameric structures of this small membrane protein (~21 kDa/protomer) resolve its periplasmic loops and carboxyl terminus that close and open the channel, and define a gating mechanism that is pH dependent and requires cooperativity between protomers in the hexamer. Gating is further associated with well-resolved changes in the channel-lining residues that modify the shape and length of the urea pore. Site-specific mutations in the periplasmic domain and urea pore identified key residues important for channel function. Drugs blocking the urea pore based on our structures should lead to a new strategy forH. pylorieradication.