Sleep disorders have been linked to alterations of gut microbiota composition in adult humans and animal models, but it is unclear how this link develops. With longitudinal assessments in 162 healthy infants, we present a so far unrecognized sleep-brain-gut interrelationship. First, we report a link between sleep habits and gut microbiota: daytime sleep is associated with bacterial diversity, and nighttime sleep fragmentation and variability link with bacterial maturity and enterotype. Second, we demonstrate a sleep-brain-gut link: bacterial diversity and enterotype are associated with sleep neurophysiology. Third, we show that the sleep-brain-gut link is relevant in development: sleep habits and bacterial markers predict behavioral-developmental outcomes. Our results demonstrate the dynamic interplay between sleep, gut microbiota, and the maturation of brain and behavior during infancy, which aligns with the lately emerging concept of a sleep-brain-gut axis. Importantly, sleep and gut microbiota represent promising health targets since both can be modified non-invasively. As many adult diseases root in early childhood, leveraging protective factors of adequate sleep and age-appropriate gut microbiota in infancy could constitute a health promoting factor across the entire human lifespan.