Dinosaurs may have survived the asteroid strike which wiped them out if it had happened slightly earlier or later in history, a new study has found.
The study using up-to-date fossil records and improved analytical tools has helped palaeontologists to build a new narrative of the prehistoric creatures' demise, some 66 million years ago.
They found that in the few million years before a 10km-wide asteroid struck what is now Mexico, Earth was experiencing environmental upheaval.
This included extensive volcanic activity, changing sea levels and varying temperatures.
At this time, the dinosaurs' food chain was weakened by a lack of diversity among the large plant-eating dinosaurs on which others preyed. This was probably because of changes in the climate and environment.
This created a perfect storm in which dinosaurs were vulnerable and unlikely to survive the aftermath of the asteroid strike.
The impact would have caused tsunamis, earthquakes, wildfires, sudden temperature swings and other environmental changes. As food chains collapsed, this would have wiped out the dinosaur kingdom one species after another.
The only dinosaurs to survive were those who could fly, which evolved to become the birds of today, said researchers.
Researchers suggest that if the asteroid had struck a few million years earlier, when the range of dinosaur species was more diverse and food chains were more robust, or later, when new species had time to evolve, then they very likely would have survived.
An international team of palaeontologists led by the University of Edinburgh studied an updated catalogue of dinosaur fossils, mostly from North America, to create a picture of how dinosaurs changed over the few million years before the asteroid hit.
They hope that ongoing studies in Spain and China will aid even better understanding of what occurred.
"The dinosaurs were victims of colossal bad luck. Not only did a giant asteroid strike, but it happened at the worst possible time, when their ecosystems were vulnerable. Our new findings help clarify one of the enduring mysteries of science," Dr Steve Brusatte, of the University of Edinburgh's School of GeoSciences, said.
"There has long been intense scientific debate about the cause of the dinosaur extinction," Dr Richard Butler of the School of Geography, Earth and Environmental Sciences at the University of Birmingham, said.
"Although our research suggests that dinosaur communities were particularly vulnerable at the time the asteroid hit, there is nothing to suggest that dinosaurs were doomed to extinction.
"Without that asteroid, the dinosaurs would probably still be here, and we very probably would not," Butler said.