Forty thousand years ago, ­gigantic land mammals thrived in South America.

But because bird bones are more brittle, they are less likely to have survived as fossils. As a result, we know much less about what flew through the skies of the Lujanian Age than what stalked the ground below.

Now, researchers have discovered anew species of ancient owl from the Andes — and it was just as formidable as its massive counterparts on land.

Between 2009 and 2012, a team of South American researchers studied a site that showed evidence of being an ancient owl burrow. Tucked in the Andes in central Ecuador, the burrow contained not only the remains of a fossilized owl but also its prey.

And what an owl: Asio ecuadoriensis, as it has been named, stood more than two feet and had a wingspan of nearly five feet. The bird had long, spindly legs that helped it capture active prey.

The remains of rabbits, shrews and mice were found in the burrow. But so were fossilized bones of other owls. When the researchers analyzed the bones, they showed wear that’s common on bones exposed to digestive fluids.

Digestion plus location led to an intriguing conclusion: The owl seems to have eaten other owls.

“This giant owl was practically what could be called a cannibal owl,” Federico Agnolin, a co-author of the study, said in a news release. Agnolin, a researcher at the Argentine Museum of Natural Sciences’ laboratory of comparative anatomy and evolution of vertebrates, called the find a “biological rarity.”

The study, which was also written by Gastón Lo Coco, a researcher at the same laboratory, and paleontologist José Luis Román Carrión of Ecuador’s National Polytechnic School’s Natural History Museum, was recently published in the Journal of Ornithology.

Some modern owls, such as the great horned owl, have been known to snack on other owls. But the find is the first of its kind among fossilized owls.

Despite its formidable size and fearsome food preferences, Asio ecuadoriensis eventually succumbed to an abrupt change in climate about 10,000 years ago at the end of the Ice Age.