BackgroundGut microbiota have a complex role on the survivability, digestive physiology, production, and growth performance in animals. Recent studies have emphasized the effects of prebiotics therapy on the gut disease, but the relationship between elephant gut-related diseases and prebiotics remains elusive. Here, a case study was undertaken to evaluate the mechanism of inulin treatment in colic in Asian elephant (Elephas maximusLinnaeus).MethodsFecal samples were collected from a sick elephant and four healthy elephants. Analysis of microbial profile was carried out by 16S rRNA sequencing, and the short chain fatty acids were tested by gas chromatography. The physiological function of “inulin-microbiota” of elephant was verified in mice by fecal microbial transplantation (FMT). The expression of related proteins was determined by Western blotting and qPCR.Results(1) Eating inulin can cure gut colic of the sick elephant and changed gut microbiota. (2) It was found that “inulin microbiota” from the post-treatment elephants can promote the proliferation of intestinal cells, increase the utilization of short chain fatty acids (SCFAs), maintain intestinal barrier, and reduce the inflammation in mice. (3) The mechanism was inulin—gut microbiota—SCFAs—immune barrier.ConclusionsInulin contributed to rehabilitate the gut microbiota and gut immune barrier of the elephant with colic. This provides reasonable verification for using prebiotics to treat the colic in captive elephants.Prebiotics will foresure play an increasingly important role in disease prevention and treatment of captive animals in the future.Graphical AbstractVideo AbstractSupplementary InformationThe online version contains supplementary material available at 10.1186/s40168-023-01581-3.