Just over 66 million years ago, Earth’s fate changed dramatically with the arrival of a massive asteroid that slammed into what is the present-day Yucatan Peninsula in Mexico. It was a devastating impact that ejected material into Earth’s atmosphere, shrouded much of the planet in darkness, and prompted the mass extinction of untold numbers of species. It’s hard to say what Earth would be like today if that asteroid hadn’t arrived, but a new study suggests an event that took place before the asteroid impact may have already had many organisms struggling to survive.

A new research paper published in Nature Communications lays out the evidence for a series of large-scale volcanic eruptions across India’s Deccan Traps. It’s these eruptions, the researchers say, that may have spewed enough toxic material into the atmosphere to poison many types of plants and animals during the million-or-so years the eruptions continued.

Digging back in time, the researchers took samples and chemical readings of the material, revealing that high concentrations of mercury were present in ancient shells from shortly before the asteroid impact and extending for many years.

“For the first time, we can provide insights into the distinct climatic and environmental impacts of Deccan Traps volcanism by analyzing a single material,” lead author Kyle Meyer explains. “It was incredibly surprising to see that the exact same samples where marine temperatures showed an abrupt warming signal also exhibited the highest mercury concentrations, and that these concentrations were of similar magnitude to a site of significant modern industrial mercury contamination.”

Ultimately it’s very difficult to determine which environmental factors were most responsible for the mass dying off dinosaurs and other ancient species. Some may have died out from poisoning well in advance of the impact, while others may have succumbed to a combination of the two events.