Metabolomics is a technique used to non-invasively determine metabolic status of an organism. Aim of our study was to analyze urinary metabolic profiles in term and preterm infants in order to identify gestational age-related metabolic differences and to predict metabolic maturity at birth. Twenty-six healthy term infants and 41 preterm infants were prospectively enrolled. A urine sample was collected non-invasively within the first hours of life. Samples were analyzed by proton nuclear magnetic resonance (1H NMR) spectroscopy and NMR urine spectra were analyzed by multivariate statistical analysis. Distinct metabolic patterns were found between term infants and preterm infants, as well as between preterm infants of 23-32 weeks' gestation and those of 33-36 weeks' gestation. Individual metabolites discriminating between these groups were hippurate, tryptophan, phenylalanine, malate, tyrosine, hydroxybutyrate, N-acetyl-glutamate, and proline. Metabolomic analysis revealed distinct urinary metabolic profiles in neonates of different gestational ages, and identified the discriminating metabolites. This holistic approach appears to be a promising tool for investigating newborn metabolic maturation over time, and might lead to a tailored management of neonatal disorders.