Early-life interventions in the intestinal environment have previously been shown to influence diabetes incidence. We therefore hypothesized that a gluten-free (GF) diet, known to decrease the incidence of type 1 diabetes, would protect against the development of diabetes when fed only during the pregnancy and lactation period. Pregnant nonobese diabetic (NOD) mice were fed a GF or standard diet until all pups were weaned to a standard diet. The early-life GF environment dramatically decreased the incidence of diabetes and insulitis. Gut microbiota analysis by 16S rRNA gene sequencing revealed a pronounced difference between both mothers and their offspring on different diets, characterized by increased numbers of Akkermansia, Proteobacteria, and TM7 in the GF diet group. In addition, pancreatic forkhead box P3 regulatory T cells were increased in GF-fed offspring, as were M2 macrophage gene markers and tight junction-related genes in the gut, while intestinal gene expression of proinflammatory cytokines was reduced. An increased proportion of T cells in the pancreas expressing the mucosal integrin alpha 4 beta 7 suggests that the mechanism involves increased trafficking of gut-primed immune cells to the pancreas. In conclusion, a GF diet during fetal and early postnatal life reduces the incidence of diabetes. The mechanism may involve changes in gut microbiota and shifts to a less proinflammatory immunological milieu in the gut and pancreas.