Dinosaurs came to rule Earth after a mass extinction wiped out about 75 percent of life 200 million years ago. Scientists have long debated the cause of the extinction. Now researchers have found that volcanic eruptions may have killed off many other species and paved the way for the dawn of the dinos.

Scientists at the University of Oxford in England took samples of ancient sediment from six locations around the world. They found that most of the rocks contained traces of volcanic gases from around the time of the extinction.

Periods of eruptions lasting as long as a million years likely produced ash that blocked the sun and released gases toxic to many living things, changing the composition of the atmosphere and altering the climate. But dinosaurs survived while other creatures perished, says geologist Lawrence Percival. “They thrived in the volcanic landscape and went on to dominate Earth.”