The timing of formation for the first planetesimals determines the mode of planetary accretion and their geophysical and compositional evolution. Astronomical observations of circumstellar discs and Solar System geochronology provide evidence for planetesimal formation during molecular cloud collapse, much earlier than previously estimated. Here, we present distinct observational evidence from white dwarf planetary systems for planetesimal formation occurring during the first few hundred thousand years after cloud collapse in exoplanetary systems. A significant fraction of white dwarfs have accreted planetary material rich in iron core or mantle material. In order for the exo-asteroids accreted by white dwarfs to form iron cores, substantial heating is required. By simulating planetesimal evolution and collisional evolution we show that the most likely heat source is short-lived radioactive nuclides such as 26 Al (t 1/2 ∼ 0.7 Myr). Core-rich materials in the atmospheres of white dwarfs, therefore, provide independent evidence for rapid planetesimal formation, concurrent with star formation.