Canadian scientists have announced the discovery of a fossil preserved with its last meal, a rare finding that sheds light on what the ancient ecosystem may have looked like.

There have only been 20 other cases where a carnivorous dinosaur's last meal had been preserved. On Tuesday, a team of researchers from Canada, the U.S., the U.K. and China published their findings describing their discovery of a mammal foot inside the ribcage of a microraptor.

“At first, I couldn’t believe it. There was a tiny rodent-like mammal foot about a centimetre long perfectly preserved inside a microraptor skeleton. These finds are the only solid evidence we have about the food consumption of these long extinct animals – and they are exceptionally rare,” study co-author Hans Larsson of McGill University said in a news release.

Microraptors were feathered dinosaurs that lived in the early cretaceous period around 120 to 125 million years ago. They were about the size of a crow and the first specimens were discovered in China in the early 2000s.

“The great thing is that, like your housecat which was about the same size, microraptor would have been an easy animal to live with but a terror if it got out as it would hunt everything from the birds at your feeder to the mice in your hedge or the fish in your pond," Alex Dececchi of Mount Marty College, another co-author of the study, said in a news release.

It's unclear which species of mammal the foot once belonged to. The authors note that its digits were slender, similar to the rodent-like eomaia and sinodelphys species that lived around that period. However, the bone proportions suggest that this creature may have been a land-dweller, unlike the tree-climbing eomaia and sinodelphys.

It's also unclear whether this microraptor's last meal was scavenged or hunted. While the size of the mammal, which was about as big as a mouse, suggests that it might have been prey, the researchers note that it's quite common for carnivores like microraptors to engage in both scavenging and predation.

Previous research looking into the microraptor has already established that the creature's diet likely included birds, lizards and fish.

"This new find adds a small mammal to their diet, suggesting these dinosaurs were opportunistic and not picky eaters,” Larsson said.

The researchers also note this discovery adds that the evidence that the microraptor was a generalist carnivore. Generalist carnivores, such as foxes and crows, play an important stabilizing role in ecosystems as they can eat a wide variety of species depending on which populations are more abundant.

“Knowing that microraptor was a generalist carnivore puts a new perspective on how ancient ecosystems may have worked and a possible insight into the success of these small, feathered dinosaurs,” Larsson said.