We studied the role of duodenal cellular ion transport in epithelial defense mechanisms in response to rapid shifts of luminal pH. We used in vivo microscopy to measure duodenal epithelial cell intracellular pH (pH(i)), mucus gel thickness, blood flow, and HCO secretion in anesthetized rats with or without the Na(+)/H(+) exchange inhibitor 5-(N,N-dimethyl)-amiloride (DMA) or the anion transport inhibitor DIDS. During acid perfusion pH(i) decreased, whereas mucus gel thickness and blood flow increased, with pH(i) increasing to over baseline (overshoot) and blood flow and gel thickness returning to basal levels during subsequent neutral solution perfusion. During a second brief acid challenge, pH(i) decrease was lessened (adaptation). These are best explained by augmented cellular HCO uptake in response to perfused acid. DIDS, but not DMA, abolished the overshoot and pH(i) adaptation and decreased acid-enhanced HCO secretion. In perfused duodenum, effluent total CO(2) output was not increased by acid perfusion, despite a massive increase of titratable alkalinity, consistent with substantial acid back diffusion and modest CO(2) back diffusion during acid perfusions. Rapid shifts of luminal pH increased duodenal epithelial buffering power, which protected the cells from perfused acid, presumably by activation of Na(+)-HCO cotransport. This adaptation may be a novel, important, and early duodenal protective mechanism against rapid physiological shifts of luminal acidity.