Other than exposure to gluten and genetic compatibility, the gut microbiome has been suggested to be involved in celiac disease (CD) pathogenesis by mediating interactions between gluten/environmental factors and the host immune system. However, to establish disease progression markers, it is essential to assess alterations in the gut microbiota before disease onset. Here, a prospective metagenomic analysis of the gut microbiota of infants at risk of CD was done to track shifts in the microbiota before CD development. We performed cross-sectional and longitudinal analyses of gut microbiota, functional pathways, and metabolites, starting from 18 mo before CD onset, in 10 infants who developed CD and 10 matched nonaffected infants. Cross-sectional analysis at CD onset identified altered abundance of six microbial strains and several metabolites between cases and controls but no change in microbial species or pathway abundance. Conversely, results of longitudinal analysis revealed several microbial species/strains/pathways/metabolites occurring in increased abundance and detected before CD onset. These had previously been linked to autoimmune and inflammatory conditions (e.g., Dialister invisus, Parabacteroides sp., Lachnospiraceae, tryptophan metabolism, and metabolites serine and threonine). Others occurred in decreased abundance before CD onset and are known to have anti-inflammatory effects (e.g., Streptococcus thermophilus, Faecalibacterium prausnitzii, and Clostridium clostridioforme). Additionally, we uncovered previously unreported microbes/pathways/metabolites (e.g., Porphyromonas sp., high mannose–type N-glycan biosynthesis, and serine) that point to CD-specific biomarkers. Our study establishes a road map for prospective longitudinal study designs to better understand the role of gut microbiota in disease pathogenesis and therapeutic targets to reestablish tolerance and/or prevent autoimmunity. Significance The incidence of chronic inflammatory autoimmune conditions, such as celiac disease (CD), is increasing at an alarming rate. CD is the only autoimmune condition for which the trigger, gluten, is known. However, its etiology and pathogenesis remain incompletely defined as recent studies suggest other environmental stimuli may play a key role in CD pathogenesis. Here, we prospectively examine the trajectory of the gut microbiota starting 18 mo before CD onset in 10 infants who developed CD and 10 infants who did not. We identified alterations in the gut microbiota, functional pathways, and metabolome before CD onset, suggesting our approach may be used for disease prediction with the ultimate goal of identifying early preventive interventions to reestablish tolerance and prevent autoimmunity.