Background: Early-life gut microbiota development is shaped by environmental exposures, yet the impact of the urban exposome remains poorly understood. Here, we comprehensively examined whether the urban exposome influences gut microbiota diversity, composition, functional potential, and metabolic activity during early childhood.Methods: We conducted a prospective longitudinal analysis within the population-based Barcelona Life Study Cohort. Urban-related exposures, including air pollution, green spaces, surrounding greenness, and socioeconomic status were assessed from conception to 18 months. During the 6-month and 18-month follow-up visits, 1,076 faecal samples were collected, generating shotgun metagenomic and liquid chromatography-tandem mass spectrometry-based short-chain fatty acid (SCFA) data for 631 children. These data enabled longitudinal characterisation of microbial diversity, taxonomic composition, functional potential, and metabolic activity across the developmental and transitional stages of gut microbiota maturation. Associations were evaluated using a sequential multivariate framework combining PERMANOVA, distance-based redundancy analysis, linear regression, and mixed-effects models, incorporating inverse probability weighting, extensive confounder adjustment, and multiple-testing correction.Findings: The urban exposome explained a proportion of gut microbiota variation, with more consistent associations at 18 than at 6 months, although its contribution remained substantially smaller than that of proximal determinants (i.e., diet, delivery-related factors, recent antibiotic use, gastrointestinal infections). Green-space exposures were consistently associated with taxa linked to microbiota maturation, whereas air pollution was associated with shifts toward oral-associated taxa and reduced abundance of Bifidobacterium species. Associations with functional pathways and SCFAs were weaker and less consistent.Interpretation: The urban exposome, particularly green spaces and air pollution, was associated with gut microbiota composition, especially during the transitional phase of microbiome maturation. Associations were mainly observed at the taxonomic compositional level, with comparatively more limited evidence for functional potential or downstream metabolic alterations. These findings suggest that the transitional microbiome may be particularly environmentally responsive to the urban exposome and highlight the potential role of the urban environments in shaping gut microbiota development during early childhood.