A new study has revealed that certain dinosaur species were in decline millions of years before the meteorite that's credited for wiping most of them out smashed into Earth.

That's a pretty huge deal, because the results could finally put an end to one of the longest-running debates in palaeontology, and help us understand once and for all what happened in the final years of the non-avian  dinosaurs on Earth.

"One of the things that has been long debated about dinosaur evolution is whether they were reigning strong right up until the time of the meteorite impact, or whether there was a slow, gradual decrease in [the emergence of new species] or an increase in extinction before that time," one of the researchers, Chris Venditti, from the University of Reading in the UK, told The Guardian.

To figure out what happened, Venditti and his team used statistical analysis and fossil record data to create a family tree of the three main types of dinosaurs: the ornithischians (beaked herbivores), theropods (carnivores such as T. rex), and sauropods (long-necked plant-eaters).

They found that while dinosaurs began to flourish during the late Triassic period around 220 million years ago, certain species began dying off faster than they could be replaced around 100 million years later.

That's tens of millions of years before the 9.6-km Chicxulub meteorite hit Earth.

Prior to this research, many scientists thought that dinosaurs had been flourishing up until then. But this study suggests that the group was actually in a long-term decline - and that could have been what made them so susceptible to being wiped out.

"While the asteroid impact is still the prime candidate for the dinosaurs' final disappearance, it is clear that they were already past their prime in an evolutionary sense," said lead researcher Manabu Sakamoto, from the University of Reading.

"Our work is ground-breaking in that, once again, it will change our understanding of the fate of these mighty creatures. While a sudden apocalypse may have been the final nail in the coffin, something else had already been preventing dinosaurs from evolving new species as fast as old species were dying out," he added.

What scientists think right now is that when the Chicxulub meteorite hit Earth 66 million years ago, it threw millions of tonnes of dust up into the atmosphere, blocking the Sun's rays and causing short-term cooling and widespread plant die-off.

But while the majority of the dinosaurs couldn't survive those changes, other species, such as the mammals, managed to eventually bounce back.

The team suggests that the weakening dominance of the dinosaurs before the impact could have given mammals the edge to endure the asteroid impact.

"The decline of the dinosaurs would have left plenty of room for mammals, the group of species which humans are a member of, to flourish before the impact, priming them to replace dinosaurs as the dominant animals on earth," said Venditti.

The study can also help us predict groups of animals alive today that will be particularly vulnerable to extinction - namely those that are losing species faster than they can replace them. "This has huge implications for our current and future biodiversity, given the unprecedented speed at which species are going extinct owing to the ongoing human-caused climate change," said Sakamoto.

But there's still one question that everyone's dying to know: does this study mean that dinosaurs would have gone extinct anyway, regardless of the meteorite?

"If they continued on that trajectory, even if that meteor didn't hit, they may well have been very species-poor in some millions of years or even have gone extinct all together," Venditti told The Guardian.

But palaeontologist Stephen Brusatte from the University of Edinburgh doesn't agree. 

"It may be that the effects of the asteroid were a bit worse because you had dinosaurs that maybe weren't as strong in an evolutionary sense as they once had been," he said. "But I think if there was no asteroid you would still have dinosaurs around today."

The research has been published in the Proceedings of the National Academy of Sciences.