Understanding the mechanism of spontaneous formation of ribonucleotides under realistic prebiotic conditions is a key open issue of origins-of-life research. In cells, de novo and salvage nucleotide enzymatic synthesis combines 5-phospho-α-D-ribose-1-diphosphate (α-PRPP) and nucleobases. Interestingly, these reactants are also known as prebiotically plausible compounds. Combining ab initio simulations with mass spectrometry experiments, we compellingly demonstrate that nucleobases and α-PRPP spontaneously combine, through the same facile mechanism, forming both purine and pyrimidine ribonucleotides, under mild hydrothermal conditions. Surprisingly, this mechanism is very similar to the biological one, and yields ribonucleotides with the same anomeric carbon chirality as in biological systems. These results suggest that natural selection might have optimized – through enzymes – a pre-existing ribonucleotide formation mechanism, carrying it forward to modern life forms.