Certain anaerobic bacteria are important for maintenance of gut barrier integrity and immune tolerance and may influence the risk of graft-versus-host disease (GVHD) after allogeneic hematopoietic stem cell transplantation (HSCT). We conducted a single-center retrospective cohort study of allogeneic HSCT recipients to evaluate associations between receipt of antibiotics with an anaerobic spectrum of activity and GVHD outcomes. We identified 1214 children and adults who developed febrile neutropenia between 7 days before and 28 days after HSCT and compared GVHD risk and mortality among patients who received anaerobic antibiotics (piperacillin-tazobactam or carbapenems; n=491) to patients who received only antibiotics with minimal activity against anaerobes (aztreonam, cefepime, or ceftazidime; n=723). We performed metagenomic sequencing of serial fecal samples from 36 pediatric patients to compare the effects of specific antibiotics on the gut metagenome. Receipt of anaerobic antibiotics was associated with higher hazards of acute gut/liver GVHD (hazard ratio: 1.26; 95% confidence interval: 1.03-1.54) and acute GVHD mortality (hazard ratio: 1.63; 95% confidence interval: 1.08-2.46), but not chronic GVHD diagnosis (hazard ratio: 1.04; 95% confidence interval: 0.84-1.28) or chronic GVHD mortality (hazard ratio: 0.88; 95% confidence interval: 0.53-1.45). Anaerobic antibiotics resulted in decreased gut bacterial diversity, reduced abundances of Bifidobacteriales and Clostridiales, and loss of bacterial genes encoding butyrate biosynthesis enzymes from the gut metagenome. Acute gut/liver GVHD was preceded by a sharp decline in bacterial butyrate biosynthesis genes with antibiotic treatment. Our findings demonstrate that exposure to anaerobic antibiotics is associated with increased risks of acute gut/liver GVHD and acute GVHD mortality after allogeneic HSCT. Use of piperacillin-tazobactam or carbapenems should be reserved for febrile neutropenia cases in which anaerobic or multidrug-resistant infections are suspected.