Hospitalized preterm infants receive frequent and often prolonged exposures to antibiotics because they are vulnerable to infection. It is not known whether the short-term effects of antibiotics on the preterm infant gut microbiota and resistome persist after discharge from neonatal intensive care units. Here, we use complementary metagenomic, culture-based and machine learning techniques to study the gut microbiota and resistome of antibiotic-exposed preterm infants during and after hospitalization, and we compare these readouts to antibiotic-naive healthy infants sampled synchronously. We find a persistently enriched gastrointestinal antibiotic resistome, prolonged carriage of multidrug-resistant Enterobacteriaceae and distinct antibiotic-driven patterns of microbiota and resistome assembly in extremely preterm infants that received early-life antibiotics. The collateral damage of early-life antibiotic treatment and hospitalization in preterm infants is long lasting. We urge the development of strategies to reduce these consequences in highly vulnerable neonatal populations.