Chimpanzees and humans have a similar sense of fair play, a new study suggests.
Both lean towards a fair distribution of rewards while playing the "Ultimatum Game", a standard method of studying human fairness used by psychologists.
But in both species, fairness only goes so far. When it is possible to be selfish with impunity, charity tends to be forgotten.
The results suggest human attitudes to fairness have a long evolutionary history.
Scientists studied both chimps and human children taking part in the game, which involves one of two playing partners deciding how to split a reward.
However, rewards are only distributed with the consent of the receiving partner, or respondent.
In the tests, bananas acted as rewards for the chimps and play stickers for the children, who were aged between two and seven.
Lead scientist Dr Darby Procter, from the Yerkes National Primate Research Center at Emory University in Atlanta, the US, said: "We used the Ultimatum Game because it is the gold standard to determine the human sense of fairness.
"In the game, one individual needs to propose a reward division to another individual and then have that individual accept the proposition before both can obtain the rewards. Humans typically offer generous portions, such as 50% of the reward, to their partners, and that's exactly what we recorded in our study with chimpanzees."
Co-author Dr Frans de Waal, also from Yerkes, said: "Until our study, the behavioural economics community assumed the Ultimatum Game could not be played with animals or that animals would choose only the most selfish option while playing.
"We've concluded that chimpanzees not only get very close to the human sense of fairness, but the animals may actually have exactly the same preferences as our own species."
The game involved one of a pair of players, the proposer, choosing from two tokens which could be exchanged for rewards for them both.
One token led to an even reward split, while the other favoured the proposer. But neither player received a reward without the consent of the receiving individual, or respondent.
In a variation of the game in which respondents had no opportunity to reject a reward offer, selfishness came to the fore in both chimps and humans.
Under this scenario, proposers picked the token that yielded the best result for them.
Two previous Ultimatum Game studies found apes to be completely self-interested. Proposers offered the smallest rewards possible, while respondents accepted almost anything they were given.
But in those experiments chimps were asked to choose food rewards directly, rather than exchangeable tokens. This may have yielded misleading results, say the authors of the new study.
The findings are published today in the journal Proceedings of the National Academy of Sciences.
Sensitivity to reward distributions may help chimps reap the benefits of co-operation in the wild, the scientists believe.
"Both chimpanzees and humans have prior real-life experience with inequitable outcomes, which may make them sensitive to the possibility of punishment," they wrote.
"For example, chimpanzees may refuse to share with individuals who did not previously groom them, punish theft, and protest against both advantageous and disadvantageous inequity in experimental settings. Thus, as in humans, social norms may affect performance in this task."