The origin and evolution of solar system bodies, including water on the Earth, have been discussed based on the assumption that the relevant ingredients were simply silicates and ices. However, large amounts of organic matter have been found in cometary and interplanetary dust, which are recognized as remnants of interstellar/precometary grains. Precometary organic matter may therefore be a potential source of water; however, to date, there have been no experimental investigations into this possibility. Here, we experimentally demonstrate that abundant water and oil are formed via the heating of a precometary-organic-matter analog under conditions appropriate for the parent bodies of meteorites inside the snow line. This implies that H2O ice is not required as the sole source of water on planetary bodies inside the snow line. Further, we can explain the change in the oxidation state of the Earth from an initially reduced state to a final oxidized state. Our study also suggests that petroleum was present in the asteroids and is present in icy satellites and dwarf planets.