In a discovery that helps solve a longstanding geological mystery and yields new insights into the rise of life on Earth and possibly elsewhere, researchers have found a vast reservoir of methane deep under the ocean floor.

The methane was found not in a single deposit but locked inside rocks that lie between Earth’s crust and the underlying mantle layer. Worldwide, the rocks are believed to contain billions of tons of the odorless, colorless gas, which is a key constituent of natural gas as well as a potent greenhouse gas.

“We were totally surprised,” Frieder Klein, a marine geochemist at the Woods Hole Oceanographic Institution in Massachusetts, said in a statement. Klein is the lead author of a paper about the discovery published Aug. 19 in the journal Proceedings of the National Academy of Sciences.

Methane in Earth’s atmosphere comes from a variety of biological and geological sources — everything from decaying plants in wetlands and the digestive tracts of cattle and other ruminants to coal mining and oil drilling.

Methane also spews forth from cracks in the seafloor known as hydrothermal vents, but scientists have been at a loss to explain the source of this deep-sea methane. Some scientists believe that these vents, also called “black smokers” because of the dark, chemical-rich plumes they release, could have provided the energy that led to the emergence of life on Earth billions of years ago.

For the research, Klein and two other Woods Hole scientists used a laser-based technique known as Raman spectroscopy to examine thin slices of rocks that had been pushed up to the seafloor from underlying geological layers. The rocks, including many gathered by a deep-diving research submarine known as Alvin, were collected from 160 locations around the world.

A deep-ocean submersible, Alvin can reach a depth of 4,500 meters on dives lasting up to 10 hours. Woods Hole Oceanographic Institution

The examinations revealed that almost all of the rocks contained trapped methane that formed in a chemical reaction between seawater and a mineral in the rocks called olivine. Each rock contains only small amounts of methane, but “when you take the widespread occurrence of these rocks into account, you all of a sudden realize that this is actually indeed a massive pool,” Klein told NBC News MACH.

The discovery suggests that the same geological process could have produced methane on Mars and other celestial bodies, said Jeffrey Seewald, a marine geochemist at Woods Hole and a co-author of the paper about the research.

Though Mars is now mostly dry, evidence suggests its surface held large bodies of water in the distant past. Water from those seas could have reacted with rocks to form methane that served as an energy source for as-yet-undiscovered life on the red planet, Seewald said, adding that the same thing could have happened on other worlds — such as Europa, a watery moon of Jupiter, and Enceladus, a moon of Saturn. “Something like this could be going on in those environments,” Seewald said.

Other scientists who were not involved in the research praised it.

Stephanie Olson, a geochemist at the University of Chicago, said in an email that the new finding was “an exciting result that could have astrobiological significance.” And Giuseppe Etiope, a geologist at the National Institute of Geophysics and Volcanology in Rome, echoed Seewald’s assessment, saying in an email that methane produced via the water-olivine reaction “could be the first step in the origin of life on Earth and on other planets.” But, he said, the new finding needs to be verified by additional research.

Astronomers have been searching for life on other planets and moons but have yet to find clear evidence of its existence.

Want more stories about science?

Follow NBC News MACH on Twitter and Facebook and Instagram.