Proton pump inhibitors (PPIs) and histamine-2 receptor antagonists (H2RAs) suppress gastric acid production, which can inhibit iron absorption. However, few data exist regarding whether these medications increase the risk of clinical iron deficiency. A community-based case-control study evaluated the association between acid-suppressing medication use and the subsequent risk of iron deficiency. It contrasted 77,046 patients with new iron deficiency diagnoses (January 1999-December 2013), with 389,314 controls. Medication exposures, outcomes, and potential confounders used electronic databases. We excluded patients with pre-existing risk factors for iron deficiency. Associations were estimated using conditional logistic regression. Among cases, 2343 (3.0%) received a prior ≥2-year supply of PPIs and 1063 (1.4%) received H2RAs (without PPI use). Among controls, 3354 (0.9%) received a prior ≥2-year supply of PPIs and 2247 (0.6%) H2RAs. Both ≥2 years of PPIs (adjusted odds ratio, 2.49; 95% confidence interval, 2.35-2.64) and ≥2 years of H2RAs (odds ratio, 1.58; 95% CI, 1.46-1.71) were associated with an increased subsequent risk for iron deficiency. Among PPI users, the associations were stronger for higher daily doses (>1.5 vs <0.75 PPI pills/d; P value interaction = .004) and decreased after medication discontinuation (P-trend < .001). Some of the strongest associations were among persons taking >1.5 pills per day for at least 10 years (odds ratio, 4.27; 95% CI, 2.53-7.21). No similar strong associations were found for other commonly used prescription medications. Among patients without known risk factors for iron deficiency, gastric acid inhibitor use for ≥2 years was associated with an increased subsequent risk of iron deficiency. The risk increased with increasing potency of acid inhibition and decreased after medication discontinuation.