Pigs, as one of the most common livestock species worldwide, are expected to have a fast growth rate and lower subcutaneous fatness but higher intramuscular fat ("marbling meat"). Nowadays, it is believed that not only host genetics but also its gut microbiomes can modulate farm animal phenotypes, however, many of the mechanisms remain elusive. We measured the body weight (BW), average daily gain (ADG), backfat thickness (BFT), and intramuscular fatness (IMF) of 91 Enshi pigs at 260 days of age, then genotyped each one individually using a 50K single nucleotide polymorphism array and performed 16S ribosomal RNA gene sequencing on 455 microbial samples from the jejunum, ileum, cecum, colon, and rectum. The microbial diversity showed notable spatial variation across the entire intestinal tract, with the cecum and colon having the highest α-diversity. The cecal and colonic microbiotas made greater contributions to BW and ADG and accounted for 22-37% of the phenotypic variance. The jejunal and cecal microbiotas contributed more (13-31%) to the BFT and IMF than the other segments. Finally, from cecum, colon, and jejunum, we identified eight microbial taxa that were significantly correlated with the target traits. The genera Alloprevotella and Ruminococcaceae UCG-005 were highly positively correlated with BW and ADG. The genera Prevotellaceae UCG-001 and Alistipes in the cecum and Clostridium sensu stricto 1 in the jejunum were highly positively correlated with BFT and IMF. The genera Stenotrophomonas, Sphaerochaeta, and Desulfovibrio were negatively associated with the mentioned traits. These findings could aid in developing strategies for manipulating the gut microbiota to alter production performance in pigs.