Avian pathogenic Escherichia coli can cause high morbidity, mortality, and serious economic losses to the global poultry industry. Lactic acid bacteria inhibit the growth of many pathogens, including E. coli, but the underlying mechanism remains unclear. In this study, we investigated the effect of the cell-free supernatant of Ligilactobacillus animalis 2020MB isolated from the intestinal tract of chickens on specific pathogen-free chickens infected with E. coli. The cell-free supernatant-induced inhibition of E. coli infection was determined through clinical symptom observation, pathological analysis, and qPCR. Protease and heat treatments did not affect the antibacterial activity of cell-free supernatant, suggesting that an organic acid was the antibacterial substance. Liquid chromatography-mass spectrometry and non-targeted metabolomics identified antibacterial activity for eight L. animalis 2020MB cell-free supernatant metabolites, including butyric, valeric, and succinic acids. The inhibitory activity of butyric acid was quantified by determining the minimal inhibitory concentration. Scanning electron microscopy, laser confocal microscopy, and proteomic analysis revealed that butyric acid altered the morphology and impaired the cell envelope integrity of target bacteria, leading to leakage of intracellular contents. BamA was identified as the membrane protein target for butyric acid. The findings reveal the molecular mechanism of action of L. animalis 2020MB in the chicken intestine against E. coli.