Phosphates would probably have been essential compounds for prebiotic evolution on the primitive Earth. In this context, there have been several studies of condensation of water-soluble phosphates to polyphosphates and phosphorylation and condensation or polymerization of biomolecules with polyphosphates. But most of the phosphorus on the early Earth would have been in the form of water-insoluble apatite, and the origin of the water-soluble polyphosphates required for prebiotic evolution has therefore been a mystery. Here we show, both from experiments that simulate magmatic conditions and from analysis of volatile condensates in volcanic gas, that volcanic activity can produce water-soluble polyphosphates through partial hydrolysis of P4O10. This mechanism seems to be the only viable route identified so far for the production of these species on the primitive Earth.