Background:A high-quality protein substitute, Hermetia illucens (Black soldier fly) larvae powder is rich in protein, fat, amino acid, calcium, and other substances. Due to the relatively few studies on the feeding of weaned piglets, in the present study, we replaced part or all of the fish meal with a relevant proportion of Hermetia illucens larvae powder in the feed to study its effect on weaned piglets. A total of forty-eight young female weaned piglets (Duroc ´ Landrace ´ Large White) with initial body weights (BW) 7.68 ± 0.26 kg, were randomly divided into three groups, each group had eight replicates, two pigs per replicate. Three groups containing different proportions of Hermetia illucens larvae powder (0, 4%, and 8%) were referred to as C, HI4, and HI8. We designed a 28-day feeding experiment, collecting blood and feces, thereafter inducing the piglets with oral gavage of ETEC K88 and recording diarrhea on day 29 of the experiment. Four piglets in each group were selected to collect serum, colon contents, intestinal tissue, and jejunum, ileum, colon mucosa samples.Results:The growth performance of weaned piglets remained unaffected on supplementing feed with Hermetia illucens. Compared with C+K88 group, the diarrhea rate was found to be attenuated for the Hermetia illucens supplemented group. Severe damage was evident in the case of the ileum villi of the C+K88 group, whereas improved integrity was demonstrated by the ileum villi of the HI4+K88 and HI8+K88 groups. Significantly increased expressions of the anti-inflammatory factor IL-10 in the intestinal mucosa (P < 0.05) and the tight junction proteins Occludin and Claudin-3 (P < 0.05) and reduced expression of the pro-inflammatory factor TNF-α (P < 0.05) were reflected in the HI4+K88 and HI8+K88 groups as compared to the C+K88 group. The activity of antioxidant enzymes CAT and POD (P < 0.05) also revealed an effective increase in the Hermetia illucens supplemented groups than the control. The results of immunoblotting also validated that the same ETEC K88 treatment of weaned piglets enhanced the expression of tight junction protein in the intestinal mucosa of the Hermetia illucens addition group (P < 0.05) and the integrity of the intestinal barrier was also better maintained. The experimental results affirmed that Hermetia illucens larvae powder could partially or completely replace fish meal, increase the content of Lactobacillus, reduce the content of Streptococcus, improve the body’s disease resistance, and improve intestinal health.Conclusions:ETEC-induced diarrhea will be reduced by the diet of weaned piglets containing Hermetia illucens larvae, ameliorating the immune performance of pigs. The present research provides a new perspective for insect meal as a sustainable protein source for pig feed.