More than 600 million years ago, a massive ice age radically altered the planet’s climate, resulting in a “Snowball Earth.” Now, researchers believe they have discovered how early animals on this planet survived — and thrived — during the colossal event.

Known as the Cryogenian Period, the era lasted from approximately 720 million to 635 million years ago, severely constricting the oxygen supply on the planet. But the researchers from McGill University found that the meltwater from the glaciers created pockets of oxygen in the oceans, which let life thrive until the ice age ended and they were able to emerge.

“The evidence suggests that although much of the oceans during the deep freeze would have been uninhabitable due to a lack of oxygen, in areas where the grounded ice sheet begins to float there was a critical supply of oxygenated meltwater,” the study’s lead author, Maxwell Lechte, said in a statement.

“This trend can be explained by what we call a ‘glacial oxygen pump’; air bubbles trapped in the glacial ice are released into the water as it melts, enriching it with oxygen.”

Lechte and the other researchers looked at the chemistry of the iron formations in ancient rocks that were left behind by glacial deposits in Australia, Namibia and California.

“The fact that the global freeze occurred before the evolution of complex animals suggests a link between Snowball Earth and animal evolution,” Lechte added. “These harsh conditions could have stimulated their diversification into more complex forms.”

Researchers had previously thought that life may have existed in meltwater puddles on the surface.

Lechte added that even though the study focused on the availability of oxygen, primitive organisms known as eukaryotes would have also needed food to survive the “Snowball Earth,” meaning further research is needed to determine how they were able to sustain.

The study has been published in the scientific journal PNAS.