Lactobacillus acidophilus (LA) is a common clinical probiotic that improves ulcerative colitis (UC) by restoring intestinal immune balance. However, the interaction of LA with the gut microbiota and its metabolites in the treatment of UC remains unknown. Therefore, this study seeks to elucidate whether the gut microbiota and its metabolites act as pivotal effectors in LA’s therapeutic mechanisms and how precisely they modulate intestinal immunity. In this study, we verified that LA can obviously ameliorate the disease severity, and regulate intestinal immune disorders in UC mice. Subsequently, antibiotic (ABX)-mediated depletion of the gut microflora demonstrated that the therapeutic efficiency of LA was closely associated with gut microbiota. In addition, the results of metabolomics revealed that ursodeoxycholic acid (UDCA), a metabolite of intestinal flora, may be a potential effector molecule mediating therapeutic effects of LA. Indeed, we found that UDCA can improve the macro pathological characteristics of UC mice, and through a comprehensive set of in vivo and in vitro experiments, we discovered that UDCA exerts dual effects on immune regulation. Firstly, it promotes the differentiation of Treg cells, resulting in increased secretion of anti-inflammatory cytokines. Secondly, UDCA inhibits the polarization of M1 macrophages, effectively reducing the secretion of pro-inflammatory cytokines. Moreover, we found that UDCA regulation of immune response is directly related to the RapGap/PI3K-AKT/NF-κB signaling pathway. In conclusion, LA and its metabolite, UDCA, may treat UC by activating the RapGap/PI3K-AKT/NF-κB signaling pathway and modulating Treg cells and M1 macrophages. All in all, our findings highlight the potential of microbial metabolites in enhancing probiotic for UC treatment.