The role of changes in gut microflora on upper gastrointestinal (UGI) perforations is not known. We conducted a retrospective case-control study to examine the relationship between antibiotic exposure-a proxy for microbiome modulation-and UGI perforations in a national sample. We queried a 5% random sample of Medicare (2009-2013) to identify patients ≥ 65 years old hospitalized with UGI (stomach or small intestine) perforations using International Classification of Diseases diagnosis codes. Cases with UGI perforations were matched with 4 controls, each based on age and sex. Exposure to outpatient antibiotics (0-30, 31-60, 61-90 days) prior to case patients' index hospitalization admission data was determined with Part D claims. Univariate and multivariable regression analyses were performed to evaluate the effect of antibiotic exposure on UGI perforation. Overall, 504 cases and 2016 matched controls were identified. Compared to controls, more cases had antibiotic exposure 0-30 days (19% vs. 3%, p < 0.001) and 31-60 days (5% vs. 2%, p < 0.001) prior to admission. In adjusted analyses, antibiotic exposure 0-30 days prior to admission was associated with 6.8 increased odds of an UGI perforation (95% CI 4.8, 9.8); 31-60 days was associated with 1.9 increased odds (95% CI 1.1, 3.3); and 61-90 days was associated with 3.7 increased odds (95% CI 2.0, 6.9). Recent outpatient antibiotic use, in particular in the preceding 30 days, is associated with UGI perforation among Medicare beneficiaries. Exposure to antibiotics, one of the most modifiable determinants of the microbiome, should be minimized in the outpatient setting.