For the vast majority of animals on Earth, breath is synonymous with life. Yet for the first 2 billion years of our planet's existence, oxygen was in scarce supply.

That doesn't mean Earth was lifeless for all that time, but that life was rarer and vastly different from what we know today.

It was only when more complex bacteria that could photosynthesize stepped onto the scene that everything began to change, triggering what scientists call a Great Oxidation Event. But when did all this happen? And how did it all shake out?

A new gene-analyzing technique has provided the hints of a new timeline. The estimates suggest it took bacteria 400 million years of gobbling sunlight and puffing out oxygen before life could really thrive.

In other words, there were likely organisms on our planet capable of photosynthesizing long before the Great Oxidation Event.

"In evolution, things always start small," explains geobiologist Greg Fournier from Massachusetts Institute of Technology.

"Even though there's evidence for early oxygenic photosynthesis – which is the single most important and really amazing evolutionary innovation on Earth – it still took hundreds of millions of years for it to take off."

Currently there are two competing narratives to explain the evolution of photosynthesis in special bacteria known as cyanobacteria. Some think the natural process of turning sunlight into energy arrived on the evolutionary scene quite early on but that it progressed with "a slow fuse". Others think photosynthesis evolved later but "took off like wildfire".

Much of the disagreement comes down to assumptions about the speed at which bacteria evolve and different interpretations of the fossil record.

So Fournier and his colleagues have now added another form of analysis to the mix. In rare cases, a bacterium can sometimes inherit genes not from its parents, but from another distantly related species. This can happen when one cell 'eats' another and incorporates the other's genes into its genome.

Scientists can use this information to figure out the relative ages of different bacterial groups; for example, those that have stolen genes must have pinched them from a species that existed at the same time as them.

Such relationships can then be compared to more specific dating attempts, like molecular clock models, which use the genetic sequences of organisms to trace a history of genetic changes.

To this end, researchers combed through the genomes of thousands of bacterial species, including cyanobacteria. They were looking for cases of horizontal gene transfer.

In total, they identified 34 clear examples. When comparing these examples to six molecular clock models, the authors found one in particular fit most consistently. Picking this model out of the mix, the team ran estimates to figure out how old photosynthesizing bacteria really are.

The findings suggest all the species of cyanobacteria living today have a common ancestor that existed around 2.9 billion years ago. Meanwhile, the ancestors of those ancestors branched off from non-photosynthetic bacteria roughly 3.4 billion years ago.

Photosynthesis probably evolved somewhere in between the two dates.

Under the team's preferred evolutionary model, cyanobacteria were probably photosynthesizing at least 360 million years before the GEO. If they're right, this further supports the "slow fuse" hypothesis.

"This new paper sheds essential new light on Earth's oxygenation history by bridging, in novel ways, the fossil record with genomic data, including horizontal gene transfers," says biogeochemist Timothy Lyons from the University of California at Riverside.

"The results speak to the beginnings of biological oxygen production and its ecological significance, in ways that provide vital constraints on the patterns and controls on the earliest oxygenation of the oceans and later accumulations in the atmosphere."

The authors hope to use similar gene analysis techniques to analyze organisms other than cyanobacteria in the future.

The study was published in Proceedings of the Royal Society B.