The four giant planets in the Solar System have abundances of `metals' (elements heavier than helium), relative to hydrogen, that are much higher than observed in the Sun. In order to explain this, all models for the formation of these planets rely on an influx of solid planetesimals. It is generally assumed that these planetesimals were similar, if not identical, to the comets from the Oort cloud that we see today. Comets that formed in the region of the giant planets should not have contained much neon, argon and nitrogen, because the temperatures were too high for these volatile gases to be trapped effectively in ice. This means that the abundances of those elements on the giant planets should be approximately solar. Here we show that argon, krypton and xenon in Jupiter's atmosphere are enriched to the same extent as the other heavy elements, which suggests that the planetesimals carrying these elements must have formed at temperatures lower than predicted by present models of giant-planet formation.