Background: Social contact in the early suckling period as an enriched social environment can reduce the aggressive behaviors of piglets at weaning regrouping, and improve their production performance and welfare. We speculated that the social environment could modulate the maturation of piglet intestinal microbiota at later growth stages. Therefore, we performed microbial 16S rRNA gene sequencing from fecal samples, collected at 16, 35, 42, and 63 days of age, to investigate the structure and function of intestinal microbiota in piglets that experienced early social contact. Results: The results showed that the litter weight of the piglets was not significantly different between the control (CON) and social contact (SC) groups at 35 days of age (P > 0.05), but the weight of piglets in the SC group significantly decreased at 63 days compared to the CON group (P < 0.05). While the proportion of Firmicutes were the most abundant bacterial phylum detected in both groups at all times, the proportion of Firmicutes and the Firmicutes-to-Bacteroides ratio were significantly higher in the SC group compared to the CON group and the proportion of Bacteroides was lower in the SC group compared to the CON group at 35, 42, and 63 days of age (P < 0.05). At the genus level, early social contact had a significant positive effect on the level of Lactobacillus at 35 and 42 days of age (P < 0.05), but a negative effect on Prevotella at 35, 42, and 63 days of age (P < 0.05). Furthermore, functional analysis of the microbial composition showed that the changes induced by early social contact mainly altered the relative abundance of metabolic and related pathways. From 35 days of age, the social contact notably had a negative effect on the abundance microbial pathways for protein digestion and absorption and lipid metabolism (P < 0.05). Conclusions: Early social contact truly changed the taxonomy of fecal microbiota in piglets, which in turn, impacted the potential for microbial function within the piglet intestine. At present, we speculate that providing continuous social contact negatively influences the nutrient metabolism for the growing piglets.