Bacterial histidine kinases respond to environmental stimuli by transducing a signal from an extracytosolic sensor domain to a cytosolic catalytic domain. Among them, PhoQ promotes bacterial virulence and is tightly repressed by the divalent cations such as calcium and magnesium. We have determined the crystal structure of the PhoQ sensor domain from Salmonella typhimurium in the Ca2+-bound state, which reveals a highly negatively charged surface that is in close proximity to the inner membrane. This acidic surface binds at least three Ca2+, which mediate the PhoQ-membrane interaction. Mutagenesis analysis indicates that structural integrity at the membrane proximal region of the PhoQ sensor domain promotes metal-mediated repression. We propose that depletion or displacement of divalent cations leads to charge repulsion between PhoQ and the membrane, which initiates transmembrane signaling through a change in orientation between the PhoQ sensor domain and membrane. Therefore, both PhoQ and the membrane are required for extracytosolic sensing and transmembrane signaling.