In this study, researchers from Lund University in Sweden trained ravens to use a simple machine where they dropped a rock in a tube to earn a food reward. Later, they were put in a room with the puzzle box (but no rock), which was then removed. An hour later, the birds were presented with a row of objects: the rock, and several distractions. Nearly all of them chose the rock, and 86 percent managed to successfully use it to open the machine when it was presented to them 15 minutes later.

Ravens, along with jays and crows, belong to a family of birds called corvids, known for their intelligence: Previous studies have researched how Eurasian jays, for example, stash away food for future use, instead of eating it right away. But some have argued in the past that this food caching behaviour might be the limit of their ability to plan for the future.

In fact, these birds are so intelligent that they're able to plan ahead for future events—something that has only been seen in humans and great apes until now—and will give up an immediately available reward to get a better one in the future. This is according to a new study published today in Science.

In another experiment, 78 percent of ravens were able to successfully barter with a human and exchange goods—trading a bottlecap for a reward—a higher success rate than what's been seen in similar experiments done with apes.

Read More: Crow Attacks Have Gotten So Bad That a Scientist Built a Tool to Map the Carnage

I phoned co-author Can Kabadayi, a doctoral student in cognitive science, over Skype to ask him about the new paper. (His profile photo featured two ravens perched on his head and shoulder.)

He described to me how one experiment took an eerie turn: One raven in the experiment figured out how to work their rock/box contraption first, then began teaching the method to other ravens, and finally invented its own way of doing it. Instead of dropping a rock to release a treat, the future Ruler of the Raven Kingdom constructed a layer of twigs in the tube, and pushed another stick down through the layer to force it open. The bird had to be removed from the experiment before it could teach any other birds how to do it.