How life started on Earth is an unsolved mystery. There are various hypotheses for the location ranging from outer space to the seafloor, subseafloor, or potentially deeper. Here, we applied extensive ab initio molecular dynamics simulations to study chemical reactions between NH3, H2O, H2, and CO at pressures (P) and temperatures (T) approximating the conditions of Earth's upper mantle (i.e., 10-13 GPa, 1000-1400 K). Contrary to the previous assumptions that large organic molecules might readily disintegrate in aqueous solutions at extreme P-T conditions, we found that many organic compounds formed without any catalysts and persisted in C-H-O-N fluids under these extreme conditions, including glycine, ribose, urea, and uracil-like molecules. Particularly, our free-energy calculations showed that the C-N bond is thermodynamically stable at 10 GPa and 1400 K. Moreover, while the pyranose (six-membered ring) form of ribose is more stable than the furanose (five-membered ring) form at ambient conditions, we found that the formation of the five-membered-ring form of ribose is thermodynamically more favored at extreme conditions, which is consistent with the exclusive incorporation of β-d-ribofuranose in RNA. We have uncovered a previously unexplored pathway through which the crucial biomolecules could be abiotically synthesized from geofluids in the deep interior of Earth and other planets, and these formed biomolecules could potentially contribute to the early stage of the emergence of life.