Oxygen-breathing life exists on Earth today because of changes in the planet's magma 2.5 billion years ago, two geologists say.

Oxygen currently makes up 21 percent of our atmosphere. But for the first half of Earth's existence, the air had almost no oxygen—if any humans could travel back to that ancient environment, they'd need spacesuits to survive.

Mysteriously, bacteria such as blue-green algae—which produce oxygen through photosynthesis—had existed for several hundred million years before oxygen finally managed to enrich the air during a period called the Great Oxidation Event.

Now, a new study of 70,000 rock samples from around the world may have solved the mystery of oxygen's long delay.

The rocks show a dramatic change in Earth's magma composition at the end of the Archean, which lasted from 4 to 2.5 billion years ago. (Explore a prehistoric time line.)

"This was actually somewhat unexpected to us," said study co-author C. Brenhin Keller of Princeton University.

That's because the discovery implies magma formed at greater depths during the Archean than it has anytime since.

Magma Gases Sopping Up Oxygen

Keller and his co-author Blair Schoene, also of Princeton, speculate that the change in where magma forms triggered the different chemical compositions seen in their rock samples.

Importantly, the scientists propose, such a shift could have altered the balance of iron in magma from ferrous to ferric—versions of the element that react differently with oxygen.

When volcanoes were producing magma with ferrous iron, they emitted gases that readily sopped up atmospheric oxygen, Keller said.

By contrast, when volcanoes started spewing magma with ferric iron, the gases consumed less oxygen, and photosynthesis was able to enrich the air with the element, the thinking goes.

William White of Cornell University reviewed the paper for publication but was not involved in the study. He notes that the newfound change in magma composition occurred around the same time as the rise of oxygen.

"I suspect that this isn't coincidental," he said, echoing the study's conclusions.

Some two billion years later, Earth's oxygen-rich air allowed animals—including humans—to emerge and thrive. What's more, the freshly abundant element gave rise to our planet's protective ozone layer, which shields surface life from damaging solar radiation.

First, though, the rise of oxygen subjected our planet to a mid-life crisis: Oxygen readily reacts with methane, a greenhouse gas that had been warming the world before the oxidation event.

With a drop in atmospheric methane, Earth and its inhabitants suffered the planet's first major ice age.