Astrophysical and cosmochemical data show that many kinds of hydrocarbons are widespread in space, including giant molecular clouds, diffuse interstellar medium, comets, interplanetary dust particles, and carbonaceous meteorites. Here an effort is made to show the close relation between high-molecular weight hydrocarbons observed in space and existing on Earth. Results of astrochemical modelling of dust grains in dense collapsing cores of giant molecular clouds are also presented. They show that about 10% of the total abundance of dust grains may be the result of aliphatic hydrocarbons. This dust serves as initial material for comets, formed in protosolar nebula. The problem of survival of cometary organics during impact onto the Earth is discussed, and it is shown that the so-called “soft-landing comet” hypothesis may explain the accumulation of complex hydrocarbons on the Earth's surface. We conclude that a significant fraction of terrestrial prebiotic petroleum was delivered by extraterrestrial matter.