Antibiotic exposure during pregnancy will adversely affect the growth of offspring; however, this remains controversial and the mechanism is poorly understood. To study this phenomenon, we added ceftriaxone sodium to the drinking water of pregnant rats and continuously monitored the body weight of their offspring. The results showed that compared with the control group, the offspring exposed to antibiotics during pregnancy had a higher body weight up to 3 weeks old but had a lower body weight at 6 weeks old. To determine the role of the gut microbiota and its metabolites in the growth of offspring, we collected feces for sequencing and further established that the experimental group has a different composition ratio of dominant bacteria at 6 week old, among which S24–7 correlated negatively with body weight and the metabolites that correlated with body weight-related unique flora were L-Valine, L-Leucine, Glutaric acid, N-Acetyl-L-glutamate, and 5-Methylcytosine. To further explore how they affect the growth of offspring, we submitted these data to Kyoto Encyclopedia of Genes and Genomes website for relevant pathway analysis. The results showed that compared with the control, the following metabolic pathways changed significantly: Valine, leucine, and isoleucine biosynthesis; Protein digestion and absorption; and Mineral absorption. Therefore, we believe that our findings support the conclusion that ceftriaxone sodium exposure in pregnancy has a long-lasting adverse effect on the growth of offspring because of an imbalance of gut microbiota, especially S24–7, via different metabolic pathways.