Just this week, researchers reported new evidence that certain species of dinosaur were already on the way out before an asteroid crashed into Earth some 66 million years ago. But somehow, plenty of species managed to live through this cataclysmic event, and their modern relatives are absolutely thriving today.

And now a new study suggests that the secret to the survival of avian dinosaurs and the birds they evolved into was their appetite for seeds.

Adding weight to this hypothesis is the fact that toothed birds died out at the end of the Cretaceous period, while their toothless and seed-eating companions stuck it out. With so little food left to scavenge on, it seems that being able to rely on seeds alone was quite literally a lifesaver.

As Jake Port reports for COSMOS magazine, a team of palaeontologists from Canada traced 188 of today's bird species back to their original common ancestor - a bird-like dinosaur with a toothless beak. Even with acid rain and scorched earth to contend with, seeds would still have been available and might have been crucial in keeping these birds alive.

Others weren't so lucky. With the sunlight blocked out by a blanket of dust and ash kicked up by the asteroid, plants were unable to photosynthesise, and that spelt the end for animals that relied on leaves and fruit. Further up the food chain, carnivores would also have suffered.

Of course, peering back through tens of millions of years isn't easy, but the hypothesis is backed up by a good amount of evidence.

"There were bird-like dinosaurs with teeth up until the end of the Cretaceous, where they all died off very abruptly," lead researcher, palaeontologist Derek Larson, said in a press release. "Some groups of beaked birds may have been able to survive the extinction event because they were able to eat seeds."

Larson says the bird-like creatures, known as the maniraptoran dinosaurs, are not a particularly well-known group - there's still a lot we don't yet understand about them, not least why they died off with the rest of the dinosaurs when very similar types of birds survived. The seed diet might just be the answer to that question.

Part of the research involved a careful analysis of fossil teeth to detect whether variations in shape and size decreased over time.

The researchers assumed that a loss of diversity would indicate a declining ecosystem, but that isn't what they found - there was little variation until the end of the Cretaceous period, supporting the idea that these maniraptoran dinosaurs were killed off very quickly.

Taken together, the tooth records and the ancestry data are strong evidence that birds were able to outlive their dinosaur-like cousins because they could peck away at seeds until other sources of food become available. So, if you want to survive the apocalypse, then make sure your diet consists of food that will survive it too.

The research has been published in Current Biology.