Trillions of microorganisms colonize the human gastrointestinal tract. They exert a strong influence on human health and diseases. Genes and diet are important factors in modifying gut microbial community composition. The role of genetics versus the role of shared diet, however, remains ill-defined. In this study, two genetically identical pigs in a withdrawal study of gut microbiome across four 14-d periods under two diets with different solubility of dietary fiber were used to eliminate the influence of genotype, isolating the role of diet as the main cause for difference in gut microbiome composition. In each period, the two pigs were maintained in the same environment and ate the same diet. Soybean hull diet, wheat bran diet, soybean hull diet, and wheat bran diet were provided in the first, second, third and fourth phases, respectively. Faecal microbial community of each pig under different diets was characterized using 454-pyrosequencing of amplicons from the hypervariable V3 region of the microbial 16S rRNA gene. Taxonomic classification and distance matrix was performed using Ribosomal Database Project classifier and compression-based distance, respectively. Taxonomy analysis exhibited that Firmicutes was the predominant phyla. Low solubility of dietary fiber increased Clostridia and decreased Spirochaetes at class level; raised Bacteroides, Oscillibacter and Succinivibrio and reduced Prevotella, Treponema and Escherichia at genus level. High solubility of dietary fiber played an opposite role in changing intestinal microbiome. Distance matrix analysis revealed that the individual bacterial community composition was distinctly clustered by the degree of solubility of dietary fiber.