Thiazide diuretics (thiazides) are among the most widely prescribed drugs worldwide, but their use is associated with glucose intolerance and new-onset diabetes mellitus. The molecular mechanisms remain elusive. Our study reveals that thiazides attenuate insulin secretion through inhibition of the mitochondrial carbonic anhydrase isoform 5b (CA5b) in pancreatic β cells. We furthermore discovered that pancreatic β cells express only one functional carbonic anhydrase isoform, CA5b, which is critical in replenishing oxaloacetate in the mitochondrial tricarboxylic acid (TCA) cycle (anaplerosis). These findings explain the mechanism for thiazide-induced glucose intolerance and reveal a fundamental role of CA5b in TCA cycle anaplerosis and insulin secretion in β cells.