In a clear-walled laboratory compartment, an African grey parrot faced a heap of metal washers. A human waited nearby with her hand outstretched. If the washers were given to the human, she would hand back delicious walnuts — but the parrot couldn’t reach her. It could reach its neighboring parrot, though, whose compartment had an opening. The parrot started picking up washers in its beak and passing them to its neighbor. At least one of them would get some walnuts today. “They were quite intrinsically motivated to help another,” said Désirée Brucks, a cognitive biologist at the Max Planck Institute for Ornithology in Germany. She had trained the parrots to exchange metal tokens for treats. Then she put them into paired compartments with a little opening between them. Only one bird had tokens, but only the other bird could reach her hand. From the very first trial, which was described Thursday in the journal Current Biology, the parrots with tokens gave them away, even though they got nothing in return. They’re the first non-mammals observed helping each other in this way, suggesting other animals have evolved the ability to act selflessly. Parrots were already known to be clever. Irene Pepperberg, an animal psychologist, famously taught an African grey parrot named Alex to use over a hundred words and identify shapes and colors. But there are other ways to be smart. Dr. Brucks wanted to test how African greys can relate to one another’s needs. Dr. Brucks and her co-author Auguste von Bayern tried their experiment on eight African grey parrots. They found that pairs with closer relationships before the experiment — they spent more time preening or feeding each other, for example — were more likely to help one another. Humans, too, prefer to help their friends, Dr. Brucks pointed out. But the parrots also helped others they weren’t as close with. When the researchers repeated the experiment with blue-headed macaws, another type of parrot, the birds only acted selfishly. The researchers think different social systems in the wild may help explain the different results. African greys live in huge, constantly shifting flocks. It might be important for the birds to immediately build good reputations, so that if they need help in the future — such as extra food, or help chasing off a predator — they’ll get it. Blue-headed macaws live in smaller, unchanging groups. So quickly building up a reputation might not be as important. That is “a thought-provoking potential explanation,” said Katherine Cronin, an animal welfare scientist at Lincoln Park Zoo in Chicago, who has studied helpful behavior in animals. Scientists call this kind of helpful behavior prosocial. Dr. Cronin said earlier research might lead to the opposite prediction: that the small-group-living macaws would behave more helpfully, while the African greys might not need to. She also wondered whether the blue-headed macaws just didn’t understand their partners’ needs. However, Dr. Cronin added, scientists who study such behavior in animals have often come across results that challenge their existing ideas. Finding and testing new hypotheses will help us understand why some animals have evolved to lend a hand. “In humans, it’s known that we help others because we empathize with them,” Dr. Brucks said. But researchers can’t tell whether African grey parrots feel the same way, or help others simply because they expect favors in return. They also don’t know how common it is across the animal kingdom for individuals to help each other out. Dolphins, rats and vampire bats have been all observed giving help. Dr. Brucks says only a few apes, though, have acted like the African grey parrots, aiding others with no clear benefit to themselves. What is clear is that humans aren’t the only species that helps each other, Dr. Brucks said. Over hundreds of millions of years of evolving separately, we and the African grey parrots both developed the habit of looking out for a neighbor who needs a walnut.