The purpose of this study was to determine the effect of intramammary pirlimycin on the fecal microbiome of dairy cattle. Primiparous heifers were enrolled and assigned to a treatment or control group at a ratio of 2:1. In part 1 of the study, treated heifers (T1) were given intramammary pirlimycin into one infected quarter once daily for 2 d at 24-h intervals, according to the label instructions. Control heifers received no treatment. In part 2 of the study, treated heifers (T2) were given intramammary pirlimycin into one infected quarter once daily for 8 d at 24-h intervals, according to the label instructions. All enrolled heifers (T1, T2, and control) had quarter-level milk samples aseptically collected for bacterial culture and fecal samples collected for 16S rRNA gene sequencing on d 0, 2, 7, 14, 21, and 28. Milk samples were plated on Columbia blood agar and incubated at 37°C for 24 h. Bacteria were identified using MALDI-TOF mass spectrometry. The DNA was extracted from feces using PowerFecal kits (Qiagen, Venlo, the Netherlands). The 16S rRNA gene amplicon library construction and sequencing was performed at the University of Missouri DNA Core facility. Testing for differences in fecal community composition was performed via one-way permutational multivariate ANOVA of Bray-Curtis and Jaccard similarities using Past 3.13 (https: / / folk .uio .no/ ohammer/ past/ ). Mean total count of operational taxonomic units and Chao1, Shannon, and Simpson α-diversity indices were determined and compared via t-test or Wilcoxon rank sum test. A treatment-dependent effect was present in the observed and predicted richness of feces from cows in the T1 group at d 2 posttreatment. Additionally, intramammary pirlimycin induced a significant change in the composition of the fecal microbiota by d 2 in the treated groups. Based on calculated intra-subject similarities, intramammary pirlimycin was associated with a significant acute change in the fecal microbiota of dairy heifers and that chance reversed when the antimicrobial exposure was brief, but sustained following longer exposure. Overall, intramammary pirlimycin administration affected the fecal microbiome of lactating dairy heifers. Further work is necessary to determine the effect of these changes on the heifer and the dairy environment as well as if treatment is influencing antimicrobial resistance among enteric and environmental bacteria.