Gut microbiota has been recognized as an important environmental factor in health, as well as in metabolic and immunological diseases, in which perturbation of the host gut microbiota is often observed in the diseased state. However, little is known on the role of gut microbiota in systemic lupus erythematosus. We investigated the effects of host genetics, sex, age, and dietary intervention on the gut microbiome in a murine lupus model. In young, female lupus-prone mice resembling women at childbearing age, a population with the highest risk for lupus, we found marked depletion of lactobacilli, and increases in Lachnospiraceae and overall diversity compared to age-matched healthy controls. The predicted metagenomic profile in lupus-prone mice showed a significant enrichment of bacterial motility-and sporulation-related pathways. Retinoic acid as a dietary intervention restored lactobacilli that were downregulated in lupus-prone mice, and this correlated with improved symptoms. The predicted metagenomes also showed that retinoic acid reversed many lupus-associated changes in microbial functions that deviated from the control. In addition, gut microbiota of lupus-prone mice were different between sexes, and an overrepresentation of Lachnospiraceae in females was associated with an earlier onset of and/or more severe lupus symptoms. Clostridiaceae and Lachnospiraceae, both harboring butyrate-producing genera, were more abundant in the gut of lupus-prone mice at specific time points during lupus progression. Together, our results demonstrate the dynamics of gut microbiota in murine lupus and provide evidence to suggest the use of probiotic lactobacilli and retinoic acid as dietary supplements to relieve inflammatory flares in lupus patients.