The dietary pattern can influence the immune system directly, but may also modulate it indirectly by regulating the gut microbiota. Here, we investigated the effect of a 3-months lacto-ovo-vegetarian diet on the diversity of gut microbiota and the immune system in healthy omnivorous volunteers, using high-throughput sequencing technologies. The short-term vegetarian diet did not have any major effect on the diversity of the immune system and the overall composition of the metagenome. The prevalence of bacterial genera/species with known beneficial effects on the intestine, including butyrate-producers and probiotic species and the balance of autoimmune-related variable genes/families were, however, altered in the short-term vegetarians. A number of bacterial species that are associated with the expression level of IgA, a key immunoglobulin class that protects the gastrointestinal mucosal system, were also identified. Furthermore, a lower diversity of T-cell repertoire and expression level of IgE, as well as a reduced abundance of inflammation-related genes in the gut microbiota were potentially associated with a control group with long-term vegetarians. Thus, the composition and duration of the diet may have an impact on the balance of pro-/anti-inflammatory factors in the gut microbiota and immune system.