The gut microbiota begins to colonize the host body following birth, develops during the suckling period and changes to the adult type after weaning. The early gut microbiota during the suckling period is thought to have profound effects on the host physiology throughout life but it is still unclear whether early dysbiosis is retained lifelong. Our previous study indicated that chronic nasal inflammation induces dysbiosis of gut microbiota in adult mice. In the present study, we addressed the question as to whether early exposure to chronic nasal inflammation induces dysbiosis, and if so, whether the dysbiosis is retained until adulthood and the sex differences in this effect. Male and female mice received repeated intranasal administration of lipopolysaccharide (LPS) or saline twice a week from P7 to P24 and were weaned at P24. The cecal contents were obtained for 16S rRNA analysis at 2 time points: at 4 weeks (wks), just after weaning, and at maturation to adulthood at 10 wks. The body weight did not differ between saline- and LPS-treated mice till around weaning, suggesting that the mothers' milk was given similarly to all mice. At 4 wks, the beta diversity was significantly different between saline- and LPS-treated male and female mice and the composition of the gut microbiota changed in LPS-treated mice. The abundance of phylum Bacteroidota tended to decrease and that of Firmicutes increased in LPS-treated male mice, while the abundance of Deferribacterota increased in LPS-treated female mice. At 10 wks, the beta diversity was not different between saline- and LPS-treated mice, but the abundance of family Lachnospiraceae significantly decreased in LPS-treated male and female mice by LEfSe analysis. Together, chronic nasal inflammation early in life caused transient and long-term dysbiosis of gut microbiota, which may contribute to the onset and progress of metabolic and neuropsychiatric disorders.