Celiac disease (CD) is a unique autoimmune disorder in which the genetic factors (DQ2/DQ8) and the environmental trigger (gluten) are known and necessary but not sufficient for its development. Other environmental components contributing to CD are poorly understood. Studies suggest that aspects of gluten intake might influence the risk of CD occurrence and timing of its onset, i.e., the amount and quality of ingested gluten, together with the pattern of infant feeding and the age at which gluten is introduced in the diet. In this study, we hypothesize that the intestinal microbiota as a whole rather than specific infections dictates the switch from tolerance to immune response in genetically susceptible individuals. Using a sample of infants genetically at risk of CD, we characterized the longitudinal changes in the microbial communities that colonize infants from birth to 24 months and the impact of two patterns of gluten introduction (early vs. late) on the gut microbiota and metabolome, and the switch from gluten tolerance to immune response, including onset of CD autoimmunity. We show that infants genetically susceptible to CD who are exposed to gluten early mount an immune response against gluten and develop CD autoimmunity more frequently than at-risk infants in which gluten exposure is delayed until 12 months of age. The data, while derived from a relatively small number of subjects, suggest differences between the developing microbiota of infants with genetic predisposition for CD and the microbiota from infants with a non-selected genetic background, with an overall lack of bacteria of the phylum Bacteriodetes along with a high abundance of Firmicutes and microbiota that do not resemble that of adults even at 2 years of age. Furthermore, metabolomics analysis reveals potential biomarkers for the prediction of CD. This study constitutes a definite proof-of-principle that these combined genomic and metabolomic approaches will be key to deciphering the role of the gut microbiota on CD onset.