A collision between Earth and another planet that helped form the moon may have also delivered key components for creating life, a study suggests.

Rice University researchers believe the Earth collided with another planet roughly the size of Mars more than 4.4 billion years ago.

The collision not only helped form our moon, but the planet smashing into Earth left elements such as carbon and nitrogen, called volatiles, required to form new life.

In a statement, Rajdeep Dasgupta, a petrologist at Rice University and a co-author on the study, said while scientists have known volatiles didn't originate on rocky planets like Earth, how and when these elements arrived "has been hotly debated."

"Ours is the first scenario that can explain the timing and delivery in a way that is consistent with all of the geochemical evidence," Dasgupta said.

The study was published Wednesday in the peer-reviewed journal Science Advances.

One long-standing theory for how the Earth earned these life-creating elements was via meteorites arriving right after the core formed, researchers say. However, scientists say ratios of carbon to nitrogen are higher on Earth compared to the meteorites.

Because evidence elements such as carbon and nitrogen exist everywhere but Earth's core, researchers ran a series of experiments simulating the creation of a planetary core to learn under what circumstances these elements could be absorbed.

They then took results of those experiments and ran approximately 1 billion computer simulations. The researchers compared them to conditions in the solar system to determine how these elements appear on all non-core material on Earth, which scientists call bulk silicate Earth.

"What we found is that all the evidence – isotopic signatures, the carbon-nitrogen ratio and the overall amounts of carbon, nitrogen and sulfur in the bulk silicate Earth – are consistent with a moon-forming impact involving a volatile-bearing, Mars-sized planet with a sulfur-rich core," said Grewal in a statement.

Follow Brett Molina on Twitter: @brettmolina23.