This study aimed to investigate the protective effect and underlying mechanism of Mailuo Shutong Pills(MLST) on posterior limb swelling caused by femur fracture in rats. The rats were randomly divided into a sham operation group, a model group, a low-dose MLST group(1.8 g·kg~(-1)·d~(-1)), a high-dose MLST group(3.6 g·kg~(-1)·d~(-1)), and a positive drug group(60 mg·kg~(-1)·d~(-1) Maizhiling Tablets). The femur in the sham operation group was exposed and the wound was sutured, while the other four groups underwent mechanical damage to cause femur fracture. The rats were treated with corresponding drugs by gavage 7 days before modeling and 5 days after modeling, while those in the sham operation group and the model group were given an equivalent dose of distilled water by gavage. Hematoxylin-eosin(HE) staining was used to detect the pathological injury of the posterior limb muscle tissues in rats, and the degree of hind limb swelling was measured. The enzyme-linked immunosorbent assay(ELISA) kit was used to detect the expression levels of interleukin-6(IL-6), interleukin-1β(IL-1β), and tumor necrosis factor-α(TNF-α) in the serum of rats in each group. The activity of superoxide dismutase(SOD), malondialdehyde(MDA), catalase(CAT), and glutathione peroxidase(GSH-Px) in rat serum was also measured. Western blot was used to detect the protein expression levels of heme oxygenase 1(HO-1), NAD(P)H quinone oxidoreductase 1(NQO1), and nuclear transcription factor E2-related factor 2(Nrf2) in rat posterior limb muscle tissues. The changes in the intestinal flora and intestinal metabolites in rats were detected by 16S rDNA sequencing and ultra-performance liquid chromatography-tandem mass spectrometry(UPLC-MS/MS), respectively, to explore the underlying mechanism of MLST in treating posterior limb swelling caused by femur fracture in rats. Compared with the model group, MLST significantly improved the degree of posterior limb swelling in rats, reduced the levels of serum inflammatory factors, and alleviated oxidative stress injury. The HE staining results showed that the inflammatory infiltration in the posterior limb muscle tissues of rats in the MLST groups was significantly improved. Western blot results showed that MLST significantly increased the protein expression of HO-1, NQO1, and Nrf2 in rat posterior limb muscle tissues compared with the model group. The 16S rDNA sequencing results showed that MLST improved the disorder of intestinal flora in rats after femur fracture. The UPLC-MS/MS results showed that MLST significantly affected the bile acid biosynthesis and metabolism pathway in the intestine after femur fracture, and the Spearman analysis confirmed that the metabolite deoxycholic acid involved in bile acid biosynthesis was positively correlated with the abundance of Turicibacter. The metabolite cholic acid was positively correlated with the abundance of Papilibacter, Staphylococcus, and Intestinimonas. The metabolite lithocholic acid was positively correlated with Papilibacter and Intestinimonas. The above results indicated that MLST could protect against the posterior limb swelling caused by femur fracture in rats. This protective effect may be achieved by improving the pathological injury of the posterior limb muscle, reducing the expression levels of inflammatory and oxidative stress-related factors in serum, reducing the oxidative injury of the posterior limb muscle, improving intestinal flora, and balancing the biosynthesis of bile acids in the intestine.