(CNN) When scientists find microbial life thriving in some of the most extreme environments on Earth, it gives them hope that they may be able to find life on other planets.

Now, researchers have discovered billions of bacteria living in tiny cracks in volcanic rocks beneath the ocean floor, more than nine miles below the surface of the ocean and an additional 300 feet below the ocean floor, according to a new study published Thursday.

And they believe that similar tiny, clay-filled cracks in rocks on Mars or below its surface could be a similar hub for life.

The upper oceanic crust, known as the ocean floor, has been continuously created on Earth for about 3.8 billion years. Underwater volcanoes release lava at 2,200 degrees Fahrenheit that solidifies into basaltic rock as the hot rock reacts to the cold ocean depths.

Hydrothermal vents along the ocean floor have been known to sustain bacteria and other life that convert minerals into energy, rather than light.

Previously, researchers have studied bacteria systems that were between 3.5 and 8 million years old. But 90% of the ocean floor is much older than that.

Yohey Suzuki, an associate professor in the University of Tokyo's Department of Earth and Planetary Science, and his colleagues investigated samples of basaltic lava found 328 feet below the ocean floor between Tahiti and New Zealand that ranged from 33 to 104 million years old.

There, they found a wealth of single-celled microbial life living in tiny cracks among the rock, which were rich with iron and clay. To be exact, they estimate that 10 billion bacterial cells live per cubic centimeter in these communities. (Bacteria known to live in mud along the seafloor pales in comparison, at 100 cells per cubic centimeter.)

Bacteria live densely packed into tunnels of clay minerals found in this sample of solid rock.

The researchers believe the iron content in the clay found deep below the ocean floor supports the growth of such large bacterial communities. The study published in the journal Communications Biology

"I thought it was a dream, seeing such rich microbial life in rocks," Suzuki said, "I am now almost over-expecting that I can find life on Mars. If not, it must be that life relies on some other process that Mars does not have, like plate tectonics."

From the ocean floor to Mars

The cracks form when the lava cools, creating narrow spaces less than one millimeter across. Millions of years of residue and buildup fill them with mineral-infused clay. Then, bacteria find a nice home in them and settle in.

"These cracks are a very friendly place for life. Clay minerals are like a magic material on Earth; if you can find clay minerals, you can almost always find microbes living in them," Suzuki said.

The bacteria Suzuki and his colleagues found is similar to how our cells make energy, a process that relies on organic nutrients in oxygen. Instead of the resources humans get from Earth's surface, they get what they need from the clay minerals.

Clay is something that NASA's Curiosity rover has explored quite a bit on Mars.

Since Curiosity landed in 2012, it's been exploring Gale Crater, a vast and dry ancient lake bed with a 16,404-foot mountain -- Mount Sharp -- at its center.

Streams and lakes likely filled Gale Crater billions of years ago, which is why NASA landed the rover there in 2012. Scientists want to know if ancient Mars once supported microbial life.

Mars, like Earth, also has a basaltic crust that formed four billion years ago. And in recent years, subsurface water and methane have been detected on the Red Planet.

Curiosity has observed and drilled samples of rocks rich in clay from the lake bed.

The clay minerals present in those rocks on the Martian surface could be similar to those in the ocean rock cracks.

"Minerals are like a fingerprint for what conditions were present when the clay formed. Neutral to slightly alkaline levels, low temperature, moderate salinity, iron-rich environment, basalt rock -- all of these conditions are shared between the deep ocean and the surface of Mars," said Suzuki.

His team is collaborating with researchers at NASA's Johnson Space Center in Houston, Texas, to come up with a plan for examining and analyzing rock samples that will one day be returned from Mars.

A 3D X-ray could help them peek inside the samples and search for cracks filled with minerals -- and maybe find evidence of life.

"This discovery of life where no one expected it in solid rock below the seafloor may be changing the game for the search for life in space," said Suzuki.

Studying the ocean floor

But the quest for bacteria deep beneath the ocean floor is a tricky one.

"Honestly, it was a very unexpected discovery. I was very lucky, because I almost gave up," said Suzuki.

The samples were collected in 2010 during the Integrated Ocean Drilling Program, an international marine research program, which took researchers from Tahiti to New Zealand. It stopped at three locations along the way, using a 9.7-mile-long metal tube to reach the ocean floor and then drill 410 feet below it. Core samples were retrieved, including mud, sediment and solid rock.

The samples were taken far from hydrothermal vents to prevent contamination, in case the bacteria was carried from one of them to the rocks, and the rocks were sterilized when they were brought up.

Suzuki thinly sliced the rock to find the bacteria.

Chipping away and grinding the rock didn't yield any results.

Suzuki, inspired by the thin slices of tissue samples that pathologists use to diagnose diseases, coated the rocks in epoxy to maintain the rock shape, then sliced thin layers. He washed the thin pieces with dye that would stain any DNA present.

Beneath his microscope, he saw green bacterial cells, surrounded by orange clay and black rock. Suzuki was able to conduct whole genome DNA analysis and identify what was living inside the cracks.

He found evidence of life.