Early-life antibiotic use is associated with increased risk for metabolic and immunological diseases, and mouse studies indicate a causal role of the disrupted microbiome. However, little is known about the impacts of antibiotics on the developing microbiome of children. Here we use phylogenetics, metagenomics and individual antibiotic purchase records to show that macrolide use in 2-7 year-old Finnish children (N=142; sampled at two time points) is associated with a long-lasting shift in microbiota composition and metabolism. The shift includes depletion of Actinobacteria, increase in Bacteroidetes and Proteobacteria, decrease in bile-salt hydrolase and increase in macrolide resistance. Furthermore, macrolide use in early life is associated with increased risk of asthma and predisposes to antibiotic-associated weight gain. Overweight and asthmatic children have distinct microbiota compositions. Penicillins leave a weaker mark on the microbiota than macrolides. Our results support the idea that, without compromising clinical practice, the impact on the intestinal microbiota should be considered when prescribing antibiotics.