Balantioides coliplays an important role in the diarrhea of weaned piglets, but its pathogenic potential and interaction with gut microbes remain unclear. To investigate the impact ofB. colicolonization on the gut bacterial structure and function of weaned piglets, a metagenomic analysis based on shotgun sequencing was performed on fresh fecal samples collected from tenB. coli-colonized piglets and eightB. coli-free ones in this study. The results showed that decreasing diversity and shifted composition and function of the bacterial community were detected in the weaned piglets infected byB. coli. In contrast to theB. coli-negative group, the relative abundances of some members of theFirmicutesphylum includingClostridium,Ruminococcusspecies, andIntestinimonas butyriciproducens, which produce short-chain fatty acids, were significantly reduced in theB. coli-positive group. Notably, some species of thePrevotellagenus (such asPrevotellasp. CAG:604 andPrevotella stercorea) were significantly increased in abundance in theB. coli-positive piglets. A functional analysis of the gut microbiota demonstrated that the differential gene sets for the metabolism of carbohydrates and amino acids were abundant in both groups, and the more enriched pathways inB. coli-infected piglets were associated with the sugar-specific phosphotransferase system (PTS) and the two-component regulatory system, as well as lipopolysaccharide (LPS) biosynthesis. Furthermore, several species ofPrevotellawere significantly positively correlated to the synthesis of lipid A, leading to the exporting of endotoxins and, thereby, inducing inflammation in the intestines of weaned piglets. Taken together, these findings revealed that colonization byB. coliwas distinctly associated with the dysbiosis of gut bacterial structure and function in weaned piglets. Lower relative abundances ofClostridiaceaeandRuminococcaceaeand higher abundances ofPrevotellaspecies were biomarkers ofB. coliinfection in weaned piglets.