Butyrate has been used to treat different inflammatory disease with positive outcomes, the mechanisms by which butyrate exerts its anti-inflammatory effects remain largely undefined. Here we proposed a new mechanism that butyrate manipulate endogenous host defense peptides (HDPs) which contributes to the elimination of Escherichia coli O157:H7, and thus affects the alleviation of inflammation. An experiment in piglets treated with butyrate (0.2% of diets) 2 days before E. coli O157:H7 challenge was designed to investigate porcine HDP expression, inflammation and E. coli O157:H7 load in feces. The mechanisms underlying butyrate-induced HDP gene expression and the antibacterial activity and bacterial clearance of macrophage 3D4/2 cells in vitro were examined. Butyrate treatment (i) alleviated the clinical symptoms of E. coli O157:H7-induced hemolytic uremic syndrome (HUS) and the severity of intestinal inflammation; (ii) reduced the E. coli O157:H7 load in feces; (iii) significantly upregulated multiple, but not all, HDPs in vitro and in vivo via histone deacetylase (HDAC) inhibition; and (iv) enhanced the antibacterial activity and bacterial clearance of 3D4/2 cells. Our findings indicate that butyrate enhances disease resistance, promotes the clearance of E. coli O157:H7, and alleviates the clinical symptoms of HUS and inflammation, partially, by affecting HDP expression via HDAC inhibition.