Inward-rectifier potassium channels (K-ir channels) stabilize the resting membrane potential and set a threshold for excitation in many types of cell. This function arises from voltage-dependent rectification of these channels due to blockage by intracellular polyamines. In all K-ir channels studied to date, the voltage-dependence of rectification is either strong or weak. Here we show that in cardiac as well as in cloned K-ATP channels (K(ir)6.2 + sulfonylurea receptor) polyamine-mediated rectification is not fixed but changes with intracellular pH in the physiological range: inward-rectification is prominent at basic pH, while at acidic pH rectification is very weak. The pH-dependence of polyamine block is specific for K-ATP as shown in experiments with other K-ir channels. Systematic mutagenesis revealed a titratable C-terminal histidine residue (H216) in K(ir)6.2 to be the structural determinant, and electrostatic interaction between this residue and polyamines was shown to be the molecular mechanism underlying pH-dependent rectification. This pH-dependent block of K-ATP channels may represent a novel and direct link between excitation and intracellular pH.